spawning unix command processes which run in parallel and simultaneously

Alan Tsang atsang at hk.linkage.net
Sun Jun 10 06:23:38 EDT 2001


HI, I am learning to code with Python and I encounter a technical problem.

I want to spawn a few unix command processes from a python script so that I 
can get the output from the unix command processes and use them in python.  

But I don't want to wait for the completion of one process at a time and 
then start another.  I want the python script to start the processes 
simultaneously and monitor whether anyone of them have finished and if so, 
get the output from the finished one.

It seems to me that the os and popen2 module is useful in this respect but 
I am not sure how to do it.

Is it possible to do it in python?  would be grateful if anyone can give me 
a reference to any documentation.

Thanks




More information about the Python-list mailing list