subprocess question re waiting

Dylan Evans dylan at dje.me
Mon Apr 8 08:01:52 EDT 2013


On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin <alain at dpt-info.u-strasbg.fr
> wrote:

> loial <jldunn2000 at gmail.com> writes:
>
> > I want to call a child process to run a shell script and wait for that
> > script to finish. Will the code below wait for the script to finish?
> > If not then how do I make it wait?
> [...]
> > process = subprocess.Popen(command,
> stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE,
> close_fds=True, shell=True)
>
> process.wait()
>

Or use subprocess.call instead which does what you want.


> -- Alain.
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
"The UNIX system has a command, nice ... in order to be nice to the other
users. Nobody ever uses it." - Andrew S. Tanenbaum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130408/4aea7b66/attachment.html>


More information about the Python-list mailing list