program hangs when external process crashes

Earl Eiland eee at nmt.edu
Fri Mar 18 17:15:20 EST 2005


I'm executing WinRK.exe in a loop using the following code:

for x in Files:
	Command_String = 'C:\Program Files\WinRK\WinRK.exe -create ' +
os.path.join(InputDirectory, os.path.splitext(x)[0]) + ' -set
compression_method ppmz -setg include_paths none -add ' +
os.path.join(InputDirectory, x) + ' -apply -quit'
	PROC = subprocess.Popen(Command_String)
	PROC.wait()

Occasionally, WinRK crashes, and this program hangs at PROC.wait(). 
What can I do about this?

Earl Eiland




More information about the Python-list mailing list