[python-win32] reading from console child process

Chris Maloof cjmaloof at gmail.com
Wed Mar 30 06:49:40 CEST 2005


Hello,

I'm trying to read the output from a WinXP console application using 
PythonWin -- that is, I start the application as a child process, and I want 
to be able to read the ASCII text in the application's screen.

The child app uses MSDN functions WriteConsoleOutputChar() and 
WriteConsoleOutputAttributes() for output.  Thus I think I need to use 
ReadConsoleOutput() and WriteConsoleInput() to communicate with it, as 
described here: 
http://homepages.tesco.net/~J.deBoynePollard/FGA/capture-console-win32.html 
.  Unfortunately these don't seem to be implemented in PyWin32.

Does anyone know if there's a way to do this?  I'm new at this, so my 
apologies if the question is basic or misguided, but I haven't found an 
obvious solution in the archives or elsewhere.

Thank you,
Chris 



More information about the Python-win32 mailing list