[Tutor] Can python determine Battery or AC Power?

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

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.


More information about the Tutor mailing list