John Q. Public
Thu Dec 28 23:02:32 EST 2000
I understand the reason for resetting stdout (having shot myself in the foot
when I overwrote stdout.write()). Is it safe to assume that I can overwrite
sydout for the duration of a script? This is really all I want to do, so I
can capture the output of a test and still show the tester what is happening.
Mark Hammond wrote:
> John Q. Public wrote:
> > While trying to add a journaling mechanism to python, I came across an
> > odd behavior from PythonWin when I tried to override sys.stdout. For
> > both the console and IDLE versions of the interpreter, I can override
> > sys.stdout, but not for PythonWin.
> This is a "feature". Quite often I found people running scripts that
> themself set sys.stdout. This would then mess-up Pythonwin after the
> script had completed - so Pythonwin resets stdout after running a script.
More information about the Python-list