[Python-Dev] Expect in python

Prabhu Ramachandran prabhu@aero.iitm.ernet.in
Fri, 22 Nov 2002 07:55:27 +0530

>>>>> "ESR" == Eric S Raymond <esr@thyrsus.com> writes:

[using pexpect]

    ESR> It seems to work, so far.  It's well documented and the
    ESR> examples are helpful.

I've been using it off and on to script some non-Python programs.  I
don't have the time to wrap my libraries to Python, so use pexpect to
'script' the application directly.  This is inflexible but very handy.
Actually, an interactive version of os.popen4 would be just as handy.
What I mean is that you send in commands via the input stream and the
output is sent out to the output stream without requiring that the
input stream be closed.  This is is like pexpect but does not force
you to 'expect' anything specific.