System Information

Serge Orlov Serge.Orlov at
Mon Mar 20 02:28:27 CET 2006

MidiBot at wrote:
> in the online-documentation for this and had no luck. I imagine it is
> quite easy and may even be as simple as a boolean variable...?

In general it's not so simple, since a computer can have many power

> All I want to be able to tell is whether or not my computer is being
> externally powered. More specifically
> I want to be able to have my program running, and be alerted if I
> un-plug my power adapter.
> I am using a Mac(powerbook) with if that makes any
> difference.

It makes big difference, device API on different operating systems is
*absolutely* different. On Mac OS X, start from ioreg:,
also take a look at command line utility for querying battery info:
These two pages should help you get started.

  -- Serge.

More information about the Python-list mailing list