Reading from a pipe (open mode w)

Alex Martelli aleaxit at yahoo.com
Thu Jan 4 09:01:35 EST 2001


"Jens Vogelgesang" <jens.vogelgesang at de.bosch.com> wrote in message
news:931d5j$m0e$1 at proxy.fe.internet.bosch.de...
> I need a wrapper to capsulate an interactive tool which is waiting for
> keyboard input.
> I can generate the input by writing into the pipe.
> To be able to retrieve the tool output, I tried to read from the pipe.
> My Problem is, that I don't know, how to flush the pipe, to force the pipe
> not to be buffered??
>
> Any hints ??

In general, if you have no control over 'the interactive tool',
you need "Expect" functionality -- see http://expectpy.sourceforge.net/
(but I don't think it works under Windows; there _is_ a version of
Expect 5.21 for Windows, http://bmrc.berkeley.edu/people/chaffee/tcltk.html,
but I think ExpectPy needs releases 5.31 or 5.32, which AFAIK have not
been ported to Win32).


Alex






More information about the Python-list mailing list