PExpect on Windows System Using Cygwin

Dave Angel davea at
Fri Sep 25 12:09:07 CEST 2009

Sean DiZazzo wrote:
> On Sep 24, 4:37 pm, Dave Angel <da... at> wrote:
>>> <snip>
>> Why not just use the subprocess module?   It's built into the Windows
>> distribution, and doesn't need cygwin.
>> DaveA
> Can subprocess pass things like passwords to running processes like
> pexpect can?
> ~Sean
I don't know what pexpect is/was capable of, since it's not apparently 
part of the current Python distributions.  I thought it had the ability 
to fork or spawn a child process, with pipes connected.

Anyway, subprocess can launch a new process, with pipes optionally 
connected back to your code.  I don't think it can attach to an 
already-running process.

There are things in pywin32 that might help (even for controlling GUI 
programs), but I suspect there'd be a big learning curve.  And of course 
it'd then be very Windows-dependent.

pywin32 -
or get it as part of the ActiveState python distro.


More information about the Python-list mailing list