[python-win32] Capturing stdout when running a Python Script

Johan Lindvall johan.lindvall at gmail.com
Mon Oct 30 08:21:49 CET 2006


I managed to solve this by setting the Std Handles (SetStdHandle) and
reopening stderr and s tdout of the Python CRT (vc 71)

Our app is built with VC 8, so I had to use a Dll built with VC 7.1 to
accomplish this (with LoadLibrary and GetProcAddress.

Code references:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp
http://dslweb.nwnexus.com/~ast/dload/guicon.htm

-- 
/Johan.


More information about the Python-win32 mailing list