spawning pyhon apps...
clp2 at rebertia.com
Sat Jan 10 00:10:20 CET 2009
On Fri, Jan 9, 2009 at 2:47 PM, bruce <bedouglas at earthlink.net> wrote:
> toying with an idea.. trying to figure out a good/best way to spawn multiple
> python scripts from a parent python app. i'm trying to figure out how to
> determine when all child apps have completed, or to possibly determine if
> any of the child processes have died/halted..
> parent app
> spawn child1
> spawn child2
> spawn child3
> spawn childn
> do i iterate through a os.waitpid(pid) for each pid of the child processes i
> is there another approach? code samples/tutorial...??
Use the `subprocess` module's
(http://docs.python.org/library/subprocess.html) Popen class to spawn
Then use .wait() or .poll(), and .returncode on the Popen instances to
check their exit status.
Follow the path of the Iguana...
More information about the Python-list