[Tutor] simultaneous pipe of stdout and stdin of an external program towards python object ?

nicolas baurin nicolas.baurin@univ-orleans.fr
Wed, 11 Oct 2000 11:36:09 +0200


Hello people,

first i'm working under NT:

well i succeed in piping the stdout of my external program towards my
python object self.log:

    pipeout=win32pipe.popen("c:\myprog.exe","r")
    a=1
    while a:
        a=pipeout.readline()
        self.log.WriteText(a)

Now i'm working on piping the stdin of this same program to this same
object (a text window) : i tryed
(pipein,pipeout)=win32pipe.popen2("c:\myprog.exe","t") but don't know
how to handle it the same way i managed pipeout
above(pipeout.readline()). More, i suspect i have to deal with 2 handles
:
    -"pipeout" to link what's inside towards self.log until it ends
    -"pipein" to link what i put in self.log towards pipein , when
pipeout is waiting for pipein

Hope i'm clear,

Merci d'avances,

P.S: Thansk to all of you who link me to this first step =;)



--
Nicolas Baurin

Doctorant
Institut de Chimie Organique et Analytique, UPRES-A 6005
http://www.univ-orleans.fr/SCIENCES/ICOA/
Université d'Orléans, BP 6759
45067 ORLEANS Cedex 2, France
Tel: (33+) 2 38 49 45 77