popen2

Piet van Oostrum piet at cs.uu.nl
Sun Oct 30 09:23:59 EST 2005


>>>>> Grant Edwards <grante at visi.com> (GE) wrote:

>GE> On 2005-10-29, Piet van Oostrum <piet at cs.uu.nl> wrote:
>GE> That would require that the application know about the named
>GE> pipe and open it.  I don't think there is any way to swap a
>GE> pipe in for stdin/stdout once a process is running.
>>> 
>>> Sure. 'myprogram' should be designed to communicate through a
>>> named pipe, or be called with named pipe(s) as stdin/stdout.

>GE> That's all well and good, but it's got nothing to do with the
>GE> OP's problem: he's got a program that's already running and he
>GE> wants to write a Python program that can "attach" pipes to that
>GE> already running program's stdin/stdout. 

He didn't state that he has no control over that program. I.e. if it is a
program that he has source code of, he could change its behaviour to use a
named pipe.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list