Hi,

Does anybody know how to get info on the battery of a macbook in python or PyObj? Or maybe ObjC so I can wrap it in python?
I need the battery percentage and if the battery is charging, discharging or charged.

I can do
Code:
import subprocess

process = subprocess.Popen(['pmset', '-g', 'pslog'], shell=False, stdout=subprocess.PIPE)
print process.stdout.readline()
but I'm looking for something more pythonic

Thanks,
Charclo