[python-win32] Re: Expect-like behavior

Roger Upole rwupole at msn.com
Sat Sep 15 00:13:33 CEST 2007


Tennis Smith wrote:
> Hi,
> 
> I'm new to both python and consequently its use on win32.  I understand
> from lots of sources that "pexpect" is the overall best Expect-like
> implementation in python. *But* I also see that the only way to make it
> work in win32 is on cygwin.   Unfortunately, that isn't an option for my
> users.  We use the ActiveState python and would like to have Expect
> functionality on that rather than installing/supporting 2 different
> python implementations on the same machine.
> 
> Mostly what's needed is the ability to spawn processes (with a timeout)
> and parse their output.
> 
> What's the best option currently available for us?

You may be able to use the win32console module, which wraps the native
Windows console functions.  It allows you to simulate interactive command
prompt input and read its output as pexpect does.

          Roger





More information about the python-win32 mailing list