working with laptop battery

Chris Colbert sccolbert at gmail.com
Sun Feb 14 03:19:59 CET 2010


You'll need acpi installed:

In [6]: import subprocess

In [7]: p = subprocess.Popen('acpi', stdout=subprocess.PIPE)

In [8]: output, errors = p.communicate()

In [9]: print output
------> print(output)
Battery 0: Full, 100%, rate information unavailable



On Sat, Feb 13, 2010 at 8:43 PM, Daniel Dalton <d.dalton at iinet.net.au>wrote:

> On Sat, Feb 13, 2010 at 05:26:02PM -0800, Chris Rebert wrote:
> > It's probably gonna depend on which OS you're running. Which would be...?
>
> Sorry, forgot to mention this. I'm running debian linux.
>
> Thanks,
> Dan
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100213/91906a32/attachment.html>


More information about the Python-list mailing list