uptime for Win XP?

Esmail Bonakdarian ebonakDUH at hotmail.com
Sun Dec 12 20:52:58 EST 2004


Bengt Richter wrote:
>  >>> import os
>  >>> [x for x in os.popen('pstat') if 'uptime' in x.lower()]
>  ['Pstat version 0.3:  memory: 327080 kb  uptime:  4 15:44:16.696 \n']
> 
> That is, if pstat.exe is on your system and path. It comes with various sdk's
> and Visual studio stuff. Check tools subdirectory under the latter.

Wow, one more way, I have VS .NET installed, I'll look for it.

Thanks!

Esmail

> Pstat prints a snapshot of pmon plus drivers info which means info about every process
> and thread running as well as drivers loaded, so the above threw away a lot of lines to get the one:
> 
> [23:38] C:\pywk\clp>pstat|wc
>         442       3350      27404
> 
> ;-)
> There's got to be something leaner though.
> 
> Regards,
> Bengt Richter



More information about the Python-list mailing list