sending data to another process's input stream?

Joe Strout joe at strout.net
Thu May 20 15:39:18 EDT 1999


Long time Python user, but Unix newbie, seeks solution to following:

I have a (C++) program which I would like users to be able to interact
with via CGI.  But this program has a lot of data in memory, and so I
need it to keep its state persistent (in memory) between CGI
invocations.

One thought is to have this program running in one process, and talk to
it via a Python CGI program running in another process.  That way, the
CGI program can come and go as CGI programs do, but the *real* (C++)
program keeps running and speaking to whomever asks.

For this to work, I need two things:

1. A way to feed input to the program running in another process.  That
program is currently reading from standard in, and it'd be nice to keep
it that way, but I could use some other mechanism if necessary.

2. A way to get the output of that program back to the CGI (Python)
program, for feeding back to the user.  Again, it's currently using
cout, but I could wrap it in some other mechanism if necessary.

Any advice on how this can be accomplished?

Many thanks,
-- Joe

-- 
,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe at strout.net             http://www.strout.net              |
`------------------------------------------------------------------'
Check out the Mac Web Directory!    http://www.strout.net/macweb.cgi




More information about the Python-list mailing list