[python-win32] Capturing stdout when running a Python Script
Mark Hammond
mhammond at skippinet.com.au
Sun Oct 29 09:48:44 CET 2006
> I am afraid my orginal post was a bit unclear. I am looking for a way
> to capture script output running in an ActiveScript Python host.
I'm afraid that is not possible - some script code will need to perform that
redirection for you, and that might need to happen for each script - the
axscript engine explicitly redirects sys.stdout to prevent 'print'
statements causing the script to crash in certain environments (including
ASP) when the default stdout is invalid.
Check out axscript\client\framework.py and search for stdout. I'd be happy
to accept patches if you have specific improvements in mind.
Cheers,
Mark
More information about the Python-win32
mailing list