Works on Unix like system only:
#!/usr/bin/python2.6
import sys,os,time
def is_running(pid):
f='/proc/'+pid+'/status'
if os.path.isfile(f):
return True
return False
while(is_running(sys.argv[1])):
time.sleep(0.1)
Usage:
./wpid pid
Comments