Tim Roberts wrote:
> Roger Upole wrote:
>> 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.
>>   
> 
> I'm not convinced of that.  The console APIs let you read keystrokes and
> write text and graphics to your OWN console window, but to the best of
> my knowledge there is nothing in there to help you either monitor or
> control another application.

By default a subprocess runs in the same console as the process that created it.
You can also explicitely pass your own console handles to be used as stdin,
stdout, and stderr.
Additionally, AttachConsole can be used to access the console of another 
process.

> The subprocess module is probably the right path for the original poster.
> 

As far as I know, the subprocess module doesn't provide any facilities for
implementing a timeout, such as async reads/writes.  The OP may be able to roll
his own using overlapped ReadFile on stdout of the subprocess, though.

         Roger

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to