blocking a program until a non-Python process terminates

Michael Hoffman cam.ac.uk at mh391.invalid
Sat Mar 12 17:09:23 EST 2005


Earl Eiland wrote:
> I'm running an .exe in Python, using subProcess.Popen.  The executable
> writes data to a file I process later on in the program.  Unfortunately,
> my program returns the error "no such file...".  How do I block
> execution until the external executable terminates?

Either:

1)

returncode = subprocess.call(cmdline)

2) or:

pipe = subprocess.Popen(cmdline)
returncode = pipe.wait()
-- 
Michael Hoffman



More information about the Python-list mailing list