PExpect on Windows System Using Cygwin

Dave Angel davea at ieee.org
Fri Sep 25 06:09:07 EDT 2009


Sean DiZazzo wrote:
> On Sep 24, 4:37 pm, Dave Angel <da... at ieee.org> 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 - http://python.net/crew/skippy/win32/Downloads.html
or get it as part of the ActiveState python distro.  
http://www.activestate.com/activepython/


DaveA




More information about the Python-list mailing list