1

I want to know if there is any library in python which can get me battery percentage remaining in Apple MACOSX(El'captain). I have researched a bit and found wmi for windows but could not find anything for MAC. Any leads appreciated.

Pankaj Mishra
  • 550
  • 6
  • 18

1 Answers1

0

A nice Python package power is available if you want to get it done quickly.

Also, you can try to execute the command line function pmset -g batt using Python subprocess module.

Finally, if you prefer, you can call the OS X native library C functions, see Battery status in OSX?.

Community
  • 1
  • 1
Neo X
  • 947
  • 7
  • 9