import os
def getpid(s):
im='"IMAGENAME eq %s"'%s
cmd="tasklist /V /FI %s"%im
s=os.popen(cmd).read()
pid=[]
i=491 ## really bad magic number
while True:
pid.append(s[i])
if s[i+1]==' ':
break
i+=1
return int(pid)
No comments:
Post a Comment