[Tutor] Windows Processes

Shitiz Bansal shitizb at yahoo.com
Sun Feb 29 18:20:10 EST 2004

I need to check whether a particular process is running on my windows machine or not.
The code i am using is:
import win32pdh
number=processes.count('process name')
if number==1:
    print 'ok'
    print 'notok'

All i need to do is to find the number of times a particular process is running.
The code works fine but the trouble is that it takes around 15 seconds to complete.
Since i do not require everything the program is doing(I already have the process name so no need to enumerate all processes and the processinfo is not required) , is there a faster and more efficient way of doing this?

Do you Yahoo!?
Get better spam protection with Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040229/b078c39c/attachment-0001.html

More information about the Tutor mailing list