[Tutor] Process Taking more than 10%

Joe Healy joe at omc-international.com.au
Fri Aug 20 02:08:13 CEST 2004


Thanks,

gave me something to google for.
I ended up finding the following worked (for my purposes (to get a list 
of processes)):

import win32pdh

# clear the cache (not an issue for me but seemed to be needed if repeating)
win32pdh.EnumObjects(None, None, 0, 1)
junk, instances = win32pdh.EnumObjectItems(None,None,"process", \ 
win32pdh.PERF_DETAIL_WIZARD)

print instances

from a thread in comp.lang.python (doing a ps in windows (is application 
XYZZT running?))


Thanks.

Joe

Shitiz Bansal wrote:

>
>
> */Joe Healy <joe at omc-international.com.au>/* wrote:
>
>     Alan Gauld wrote:
>
>     >Which platform?
>     >There are easy ways to do this on both Unix and Windows and
>     >there are harder ways. But if its only one OS we might as
>     >well stick to the easy ways... :-)
>     >
>     >
>     >
>     I think on linux you would use popen and ps, but how is it done on
>     windows?
>
>     Thanks
>
>
>     Joe Healy
>
>     _______________________________________________
>     Tutor maillist - Tutor at python.org
>     http://mail.python.org/mailman/listinfo/tutor
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now 
> <http://us.rd.yahoo.com/evt=26640/*http://promotions.yahoo.com/goldrush>.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Tutor maillist  -  Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>  
>


-- 
________________________________________________________
Joe Healy | Engineer

OMC-International | 6 Paterson St | Abbotsford, VIC 3067

Melbourne | Australia

Phone +61 (3) 9412 6500 | Fax +61 (3) 9415 9105

www.omc-international.com.au

Dedicated to safer and more efficient shipping.

CONFIDENTIAL COMMUNICATIONS. The information contained in this e-mail
is confidential and may be subject to legal professional privilege. It
is intended solely for the addressee. If you received this
correspondence by mistake, please promptly inform us by reply e-mail
or by telephoning +61 3 9412 6500 and then delete the e-mail and
destroy any printed copy. You must not disclose, copy or rely on any
part of this correspondence if you are not the intended recipient.



More information about the Tutor mailing list