Redirecting standard out in a single namespace

Ido Yehieli Ido.Yehieli at gmail.com
Fri Jan 20 17:01:37 EST 2006


I'm sorry, but i don't see how this will solve the problem? It is
exactly the same, only now you've replaced everything in sys except
just sys.stdout?
At any rate, perhapse the code you will write will be more maintainable
if instead of redirecting sys.stdout for some of the code just use a
different function (instead of print) for the times where you wish it
to be redirected somewhere else? it will probably make your code
longer, but the maintainer will have one less "gotcha" to worry about a
few months/years down the road. perhapse it is best to not do the
"clever" thing this time ;-) ?




More information about the Python-list mailing list