Popular recipes tagged "exists"http://code.activestate.com/recipes/tags/exists/popular/2012-04-15T14:13:02-07:00ActiveState Code RecipesWait for PID and check for PID existance (POSIX) (Python) 2012-04-15T14:13:02-07:00Giampaolo RodolĂ http://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/578022-wait-for-pid-and-check-for-pid-existance-posix/ <p style="color: grey"> Python recipe 578022 by <a href="/recipes/users/4178764/">Giampaolo RodolĂ </a> (<a href="/recipes/tags/exists/">exists</a>, <a href="/recipes/tags/exit/">exit</a>, <a href="/recipes/tags/pid/">pid</a>, <a href="/recipes/tags/process/">process</a>, <a href="/recipes/tags/status/">status</a>, <a href="/recipes/tags/timeout/">timeout</a>, <a href="/recipes/tags/wait/">wait</a>). Revision 7. </p> <p>Two functions: one which waits for a certain PID to terminate (with optional timeout), another one which checks whether a process with a given PID is running.</p> <p>This was extracted from <a href="http://code.google.com/p/psutil/">psutil</a> project which also provides a Windows implementation.</p> <p>Timeout functionality is implemented as a busy loop and it was inspired by <a href="http://bugs.python.org/issue5673." rel="nofollow">http://bugs.python.org/issue5673.</a></p>