popen2

Piet van Oostrum piet at cs.uu.nl
Sat Oct 29 14:17:53 EDT 2005


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

>GE> On 2005-10-29, Piet van Oostrum <piet at cs.uu.nl> wrote:
>>>>>>>> "g.franzkowiak" <g.franzkowiak at onlinehome.de> (gf) wrote:
>>> 
>gf> If starts a process with popen2.popen3('myprogram') and myprogram.exe is
>gf> running before, I've a connection to the second process, not to the first.
>gf> I can find the process by name before I start a process with popen2...,
>gf> but how bcan I connect t this process with a pipe ?
>>> 
>>> You have to use a named pipe.

>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.
-- 
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