[Tutor] Can python determine Battery or AC Power?

Alan Gauld alan.gauld at btinternet.com
Thu Oct 29 01:53:08 CET 2009


"Nick Hird" <nrhird at gmail.com> wrote

I am running Windows XP.

> 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? 

Search Microsoft Developer site (MSDN) for

GetSystemPowerStatus 

which is the function that tests for battery or AC among other things.

HTH,

Alan G



More information about the Tutor mailing list