[python-win32] winpexpect like library keeping process in a 'tty'

Gelonida N gelonida at gmail.com
Tue Dec 31 16:14:11 CET 2013


Hi,

pexpect is a python library for non windows OSes allowing to start a 
process connected to a pseudotty, capture its output and control its input.


There is some kind of equivalent module, which is called
winpexpect.

I noticed one difference however:

let's imagine, that I want to launch a Python script with following code

print sys.stdout.isatty() # find out whether running in a console


then a process started under linux with pexpect still believes it is run 
in a console,


whereas a process started with winpexpect will believe it is NOT running 
in a console.


Is there any way to start a subprocess under Windows, let it believe it 
is running in a console, but still capture its output?




More information about the python-win32 mailing list