sending data to another process's input stream?

Paul Prescod paul at prescod.net
Thu May 20 19:43:49 EDT 1999


"Joseph J. Strout" wrote:
> 
> >I think that the key was that Andrew presumed that the C++ program's only
> >communication interface was the stdin. Thus he had Python CGIs socketing
> >to Python long-lived-server piping to stdin.
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Right.  This is the bit I don't understand.  How do I do this?

You can use os.popen2 or something like it. But the trick is that the app
that calls os.popen can't close or else it loses the file handle. So you
need a long running Python app.

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"It's only a movie. People should get a life." 
 - George Lucas (http://www.nypost.com/news/9025.htm)




More information about the Python-list mailing list