Re: System idle time under Linux

2010-09-30 Thread Lawrence D'Oliveiro
In message mailman.1165.1285772270.29448.python-l...@python.org, Hugo Léveillé wrote: Sorry, I am not a linux guy. Did not know it was a text file That’s why I said to check the proc(5) man page for further details. -- http://mail.python.org/mailman/listinfo/python-list

Re: System idle time under Linux

2010-09-30 Thread Ifrit
Hugo Léveillé heeft het volgende neergekrabbeld: Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that From a unix command prompt use the cat command to view their contents. You'll notice that they plain text files with very

Re: System idle time under Linux

2010-09-30 Thread Ifrit
Ifrit heeft het volgende neergekrabbeld: Hugo Léveillé heeft het volgende neergekrabbeld: Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that From a unix command prompt use the cat command to view their contents. You'll

Re: System idle time under Linux

2010-09-30 Thread John Pinner
On Sep 29, 7:36 pm, Hugo Léveillé hu...@fastmail.net wrote: Good point One I am looking for, is time since last user mouse or keyboard action. So I guess I am looking for the exact same thing a screensaver is looking for The command who -Hu). will give you idle time for each logged-in

Re: System idle time under Linux

2010-09-30 Thread Hugo Léveillé
Ok after some testing, what the who -Hu is giving me is the idle time of each running open shell. The first line always return a ? as the IDLE time. ex: NAME LINE TIME IDLE PID COMMENT vg0619hl :0 2010-09-30 06:10 ? 13091 vg0619hl pts/1

System idle time under Linux

2010-09-29 Thread Hugo Léveillé
I have found it for windows and mac, but no luck under linux. Any idea? Thanks -- Hugo Léveillé hu...@fastmail.net -- http://mail.python.org/mailman/listinfo/python-list

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that ? Thanks alot On Thu, 30 Sep 2010 02:01 +1300, Lawrence D'Oliveiro l...@geek-central.gen.new wrote: /proc/stat or /proc/uptime, depending. See the proc(5) man page. --

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that? Good grief. They're text files. You open them, you read them, you parse the contents for the stuff you want. -- Grant

Re: System idle time under Linux

2010-09-29 Thread Thomas Jollans
On Wednesday 29 September 2010, it occurred to Hugo Léveillé to exclaim: Thanks, will take a closer look on that But to get me started, how would you get, via python, the info from that ? Parse the files. They may be very special files, but they are just files. Thanks alot On Thu,

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Sorry, I am not a linux guy. Did not know it was a text file On Wed, 29 Sep 2010 14:48 +, Grant Edwards inva...@invalid.invalid wrote: On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: Thanks, will take a closer look on that But to get me started, how would you get, via python,

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: Sorry, I am not a linux guy. Did not know it was a text file And the file command (the usual way to figure that out) doesn't appear to be helpful: $ file /etc/passwd /etc/passwd: ASCII text [That's helpful] $ file /proc/stat

Re: System idle time under Linux

2010-09-29 Thread Seebs
On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: I have found it for windows and mac, but no luck under linux. Any idea? I don't think it's semantically well-defined. What makes a system idle? Is the machine in my basement idle? I don't think anyone's touched the keyboard in a week, but

Re: System idle time under Linux

2010-09-29 Thread Hugo Léveillé
Good point One I am looking for, is time since last user mouse or keyboard action. So I guess I am looking for the exact same thing a screensaver is looking for On Wed, 29 Sep 2010 17:27 +, Seebs usenet-nos...@seebs.net wrote: On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: I

Re: System idle time under Linux

2010-09-29 Thread Seebs
On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: One I am looking for, is time since last user mouse or keyboard action. So I guess I am looking for the exact same thing a screensaver is looking for You can probably get it from X somehow, but... Basically, be aware that it is entirely

Re: System idle time under Linux

2010-09-29 Thread Grant Edwards
On 2010-09-29, Hugo L?veill? hu...@fastmail.net wrote: One I am looking for, is time since last user mouse or keyboard action. So I guess I am looking for the exact same thing a screensaver is looking for Oh. That's not what idle generally means in a Unix/Linux context, so you can disregard