Re: [Q]Two way pipes for UNIX child processes?

Rod Morehead (rmore@netcom.com)
Mon, 4 Apr 1994 05:04:48 GMT

Tim Peters (tim@ksr.com) wrote:
: rmore@netcom.com (Rod Morehead) writes:
: >...
: >What I am trying to do is run a child process, feed it some input,
: >see its response, feed it more input etc.
: >...
: >I wasn't able to spot anything that does this in the distribution. I
: >know I can get a similar effect by staging files and redirecting input
: >and output but I was hoping for a cleaner way.

: Fellow Pythonites may kill me for this, but I suggest you zoom over to
: comp.lang.perl and pick up the Perl FAQ....
***stuff deleted***
: The short course is that pipes are an inherently poor base for what you
: want to do....
***stuff deleted***
: Sockets are a better solution....
***stuff deleted***
: Tim Peters tim@ksr.com
: not speaking for Kendall Square Research Corp

Well, I went looking over in the perl source I have and basically
translated the open2 perl module code into python. The only thing left was
to use the posix.read so that my read wouldn't block. (and use select
first so that I know some output is pending.)

I know some of the problems with trying to do this, but I have certain
reasons for trying. I hadn't thought of the perl FAQ but I will
check there also.

Thanks,

Rod Morehead
rmore@netcom.com