expect or pty for win32?

Mike Müller mmueller at dgfz.de
Wed Sep 6 18:29:28 CEST 2000


I am looking for some kind of pty or expect for Win32 to mimic the console
to a command line application. All versions popen do not allow interactive
sending of commands and reading output before the pipe is closed (The
application recognizes that it is connected to a pipe and not the console as
David Bolen explained to me).

I found three different versions of expect in Python (expy, Pyexpect and
ExpectPy) but all of them seem to be for Unix (using os.system(some pty
related commands)) or FCNTL (file control something which seems Unix
specific). If I am mistaking here and they can be used on Win32 please let
me know.
Sources:
Expectpy (builds on expy) :
http://starship.python.net/crew/arcege/ExpectPy/
PyExpect :
http://theopenlab.uml.edu/pipermail/loci-general/1999-April/000006.html

There is an TCL version of  expect for Windows NT
(http://bmrc.berkeley.edu/people/chaffee/expectnt.html) which is implemented
with the help of some C code. I just don't know enough C to get it to work
with Python. But maybe someone has done this work already and wants to share
this work?

Also the cygwin installation (B20) has something called expect (expect.com)
which when called from cygwin-bash changes the prompt to expect 1.1> and
after I hit enter to expect1.2> and so on. Is there any way to utilise this
functionality for my purposes (If it is not something totally different with
just the same name).

Thanks.

Mike






More information about the Python-list mailing list