views:

209

answers:

2

hello,

I want to start a number of subprocesses in my Python script and then track when they complete or crash.

subprocess.Popen.poll() seems to return None when the process is still running, 0 on success, and non-zero on failure. Can that be expected on all OS's? Unfortunately the standard library documentation is lacking for these methods...

Is the subprocess module the most suitable to achieve this goal?

thanks

A: 

Yes to all.

nosklo
+2  A: 

This may not be a very good answer to your question, but just in case you are at risk of reinventing a wheel, take a look at Supervisor

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

And it's all written in Python, so if you feel like tinkering with it, you can dig right in!

scrible