Re: working with laptop battery

2010-02-18 Thread Daniel Dalton
On Sun, Feb 14, 2010 at 03:22:11AM +0100, Daniel Fetchinson wrote: > /proc/acpi/battery/BAT0/info > /proc/acpi/battery/BAT0/state Had a quick look, but that path doesn't seem to exist, I'll look harder on the weekend when I put the script together, because it has to be somewhere. Thanks, Dan --

Re: working with laptop battery

2010-02-18 Thread Daniel Dalton
I'm not sure I have those files, but I'll look a little harder this weekend when I put together the script. Thanks for your help, Dan On Sat, Feb 13, 2010 at 08:23:28PM -0600, Tim Chase wrote: > Daniel Dalton wrote: > >On Sat, Feb 13, 2010 at 05:26:02PM -0800, Chris Rebert wrote: > >>It's proba

Re: working with laptop battery

2010-02-18 Thread Daniel Dalton
On Sat, Feb 13, 2010 at 09:19:59PM -0500, Chris Colbert wrote: >You'll need acpi installed: >In [6]: import subprocess Thanks for that code, I'll try putting something together this weekend. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: working with laptop battery

2010-02-13 Thread Tim Chase
Daniel Dalton 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. You should be able to read/poll the various files in /proc/acpi/battery/BA

Re: working with laptop battery

2010-02-13 Thread Daniel Fetchinson
>> It's probably gonna depend on which OS you're running. Which would be...? > > Sorry, forgot to mention this. I'm running debian linux. I don't know about python modules but have a look at /proc/acpi/battery/BAT0/info /proc/acpi/battery/BAT0/state You can parse the numbers you want from there.

Re: working with laptop battery

2010-02-13 Thread Chris Colbert
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 D

Re: working with laptop battery

2010-02-13 Thread Daniel Dalton
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

Re: working with laptop battery

2010-02-13 Thread Shashwat Anand
I too am interested as to which module should I use. My OS is OS X Snow Leopard. On Sun, Feb 14, 2010 at 6:56 AM, Chris Rebert wrote: > On Sat, Feb 13, 2010 at 4:48 PM, Daniel Dalton > wrote: > > Hi, > > > > I'm constantly working in the command line and need to write a program > > to give me a

Re: working with laptop battery

2010-02-13 Thread Chris Rebert
On Sat, Feb 13, 2010 at 4:48 PM, Daniel Dalton wrote: > Hi, > > I'm constantly working in the command line and need to write a program > to give me alerts on my battery. Can someone please tell me what module > I should use to access battery information? Looking for something that > perhaps makes

working with laptop battery

2010-02-13 Thread Daniel Dalton
Hi, I'm constantly working in the command line and need to write a program to give me alerts on my battery. Can someone please tell me what module I should use to access battery information? Looking for something that perhaps makes use of acpi so I can get estimated time left as well as a percenta