Created
April 6, 2020 11:11
-
-
Save karolherbst/1b865c0fe72b178dae4138f0d6f79191 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os; | |
file_cur = open("/sys/class/power_supply/BAT0/current_now") | |
file_vol = open("/sys/class/power_supply/BAT0/voltage_now") | |
print(int(file_cur.readlines()[0][:-1])/1000000 * int(file_vol.readlines()[0][:-1])/1000000) | |
file_cur.close() | |
file_vol.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment