Alex Martelli wrote: > Have the spin function accept the pid argument and exit the loop if said > pid has terminated; to check the latter, e.g., os.kill(pid, 0) -- this > will raise an OSError if no process with that pid exists, so you can use > a try/except OSError: to catch that and break as appropriate.
or use the subprocess module instead of fork/exec, pass the Popen instance to spin, and use the poll() method to check if the process is still running. </F> -- http://mail.python.org/mailman/listinfo/python-list