[summerofcode] sys.stdout

Tony Meyer t-meyer at ihug.co.nz
Tue Jun 7 09:44:48 CEST 2005


> I'm a Python programmer. I've set the sys.stdout and
> sys.stderr to two objects. Now I need to redirect the
> error and output into command prompt. Would you please
> help me?
> Perhaps I have to re-assign the sys.stdout and stderr
> to command prompt.

Questions like this (I presume) would be better directed to
comp.languages.python (or python-list at python.org, which is the mailing list
that it's gateway'd to).

If you do something like:

old_out = sys.stdout
sys.stdot = my_out

You can then write to the regular stdout (e.g. console) with:

old_out.write("text to write).

Is that what you meant?

=Tony.Meyer



More information about the summerofcode mailing list