sending data to another process's input stream?

Nathan Clegg nathan at islanddata.com
Thu May 20 19:30:24 EDT 1999


On 20-May-99 Joseph J. Strout wrote:
> At 3:28 PM -0700 05/20/99, Paul Prescod 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?

One thought is to add socket communication to the C++ program, but what
Paul suggested was much easier:  If you start the C++ program from the
long-lived python program, it is very easy to open a pipe to C++'s stdin
and maintain communication that way.  The python program can also receive
C++'s stdout or whatever else you would like to do.  The short-lived
python CGI programs would only communicate with the other (long-lived)
python program (through sockets, the easiest way), which would handle all
communication with the C++ program for you.

----------------------------------
Nathan Clegg
 nathan at islanddata.com






More information about the Python-list mailing list