How to tell if a forked process is done?
joseph at ugcs.caltech.edu
Wed Sep 24 01:47:40 CEST 2003
I want to know how to tell if a forked process is done.
Actually, my real question is that I want to run a shell script inside
of a python script, and after the shell script has finished running, I
want to do more stuff *condition* on the fact that the shell script
has finished running, inside the same python script.
The only way I can think of is to fork a process and then call the
shell script, as in:
pid = os.fork()
if pid == 0:
but how can I know if the shell script is finished?
In sum, my two questions are:
1. How can I know if a forked shell script is finished?
2. How can I run a shell script inside a python script without
forking a new process, so that I can know the shell script is done
from within the same python script?
thanks in advance,
More information about the Python-list