Skip to site navigation (Press enter)
Re: Redirecting standard out in a single namespace
Pan Menghan
Mon, 23 Jan 2006 03:06:42 -0800
Maybe you can use __name__ to determine which module the print statement is in:
class out:
def write(s,a):
if __name__ =="myModule":
mylog.write(a)
else:
sys.__stdout__.write(a)
sys.stdout = out()
--
http://mail.python.org/mailman/listinfo/python-list
Previous message
View by thread
View by date
Next message
Re: Redirecting standard out in a single namespace
Pan Menghan
Re: Redirecting standard out in a single namespace
Fuzzyman
Re: Redirecting standard out in a single namespace
Fuzzyman
Re: Redirecting standard out in a single namespace
Bengt Richter
Re: Redirecting standard out in a single namesp...
Fuzzyman
Reply via email to
Search the site
The Mail Archive home
python-list - all messages
python-list - about the list
Expand
Previous message
Next message