popen2

Donn Cave donn at drizzle.com
Sat Oct 29 12:20:38 EDT 2005


Quoth Pierre Hanser <hanser at club-internet.fr>:
| Grant Edwards a écrit :
|> 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.
|> 
|> 
|> That would require that the application know about the named
|> pipe and open it.  I don't think there is any way to swap a
|> pipe in for stdin/stdout once a process is running.
|> 
| in C: freopen

Hello, it seems fairly clear that the stdin/stdout in question belongs
to another process, which cannot be instructed at this point to execute
freopen().  If there's a way to do this, it will be peculiar to the
platform and almost certainly not worth the effort.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list