popen hangs until closed

Mike Müller mmueller at dgfz.de
Fri Sep 1 05:37:28 EDT 2000


I try to run a command application in the background giving it a nicer GUI
interface.
I tested several methods on Win98 and NT:

os.popen
win32pipe.popen
win32pipe.popen2
win32pipe.popen3

but the result is always the same.

As long as don't call popen.close() it hangs. After the close() all my
commands I piped in are processed at once and the output is written to
stdout (popen) or the appropriate pipes (popen2 and popen3).
Seems like the in-pipe does not write to the application immediately but
waits for the close(). If  I wait between sending commands the execution
time of commands in the application is the same for all of them (= time I
called close()).

Since I want to run my background application interactively the batch like
mode described above does not help.

Is there any way to fix this from Python or is it a problem of the
application not supporting pipes properly?

Mike






More information about the Python-list mailing list