[Tutor] Can python determine Battery or AC Power?

Nick Hird nrhird at gmail.com
Wed Oct 28 22:28:47 CET 2009

I am running Windows XP.

On Wed, Oct 28, 2009 at 5:19 PM, Luke Paireepinart
<rabidpoobear at gmail.com> wrote:
> If you're on Windows and you can find an example using the Win32 api (in C++
> for example) you can use pywin32 module to do the same thing through
> python.  It's a little complicated sometimes though.  So what O.S. are you
> on?
> On Wed, Oct 28, 2009 at 4:15 PM, Nick Hird <nrhird at gmail.com> wrote:
>> Is there a way in python to tell if the power source for a laptop is
>> ac or battery? I am trying to write a small script to print out my
>> system stats and would like to know if the laptop is on battery power
>> or using ac power. I just dont know enough python to know where to
>> look for that info.
>> Thanks!
>> -Nick
>> _______________________________________________
>> Tutor maillist  -  Tutor at python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list