On 04/08/2013 08:01 AM, Dylan Evans wrote:
On Mon, Apr 8, 2013 at 9:48 PM, Alain Ketterlin <al...@dpt-info.u-strasbg.fr
wrote:
loial <jldunn2...@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
http://docs.python.org/2/library/subprocess.html#popen-objects
or use communicate(), which is what the OP had in the first place.
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list