<DIV>Hi,</DIV>
<DIV>I need to check whether a particular process is running on my windows machine or not.</DIV>
<DIV>The code i am using is:</DIV>
<DIV>&nbsp;</DIV>
<DIV>import win32pdh<BR>processinfo,processes=win32pdh.EnumObjectItems(None,None,"Process",-1)<BR>number=processes.count('process name')<BR>if number==1:<BR>&nbsp;&nbsp;&nbsp; print 'ok'<BR>else:<BR>&nbsp;&nbsp;&nbsp; print 'notok'<BR></DIV>
<DIV>All i need to do is to find the number of times a particular process is running.</DIV>
<DIV>The code works fine but the trouble is that it takes around 15 seconds to complete.</DIV>
<DIV>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?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Shitiz</DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
Get better spam protection with <a href="http://us.rd.yahoo.com/mailtag_us/*http://antispam.yahoo.com/tools">Yahoo! Mail</a>