So I have a list of pids, and I want to check whether the pids still
refer to live processes or not. Currently I'm doing that thus:

pids = ['4550\n', ...]
procs = os.popen("ps ax|grep %s|awk '{ print $1 }'" % keyword).readlines()

and comparing the two lists. I'm wondering, though, if there's a way
to do this that's less dependent on external programs. I thought
os.waitpid() might work, but on *nix I can only call it for child
processes.

Lawrence Wang
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to