[python-win32] Fetching Battery Monitor Data (Roger Upole)

FT chester_lab at fltg.net
Wed Jan 19 14:35:32 CET 2011


Hi Roger,

    OK, I had downloaded WMI after posting my message under others recommendation from another Python list and one sample file directory program worked. Will set this up and see if it works, thanks!
    But, those also said to look at several websites on tutorials and documentation. What I found there was very little and only one example but no real structured approach concerning objects and such.

    Do you or anyone have a better site to give more details? I ask this for what I found had a lot more then just this simple task you mention below, thus making it very confusing. 

    I need everything in text format since I only use a screen reader. I can read .PDF but it can be a pain. HTML tags type format is the best besides the .chm format, for you can jump around by reference and links.


You can use WMI to get the battery level.
import win32com.client
wmi=win32com.client.GetObject('winmgmts:')
b=wmi.InstancesOf('win32_battery')
print b[0].EstimatedChargeRemaining
    Roger



More information about the python-win32 mailing list