stdout

Michaell Taylor Michaell.Taylor at reis.com
Wed Jun 14 13:53:03 EDT 2000


I am having a bit of trouble redirecting output from a file back to the
terminal.  I have:

import sys
f=open('c:\output.txt', 'w')
sys.stdout=f
blah..
blah..
blah..
sys.stdout='<stdout>'
print 'finished'


which does not work.  I've searched the docs but only see references for
directing to files (which is helpful) but none for redirecting to a screen.
The last two lines aren't doing the trick.  Any ideas?

===========================

Michaell Taylor
Senior Economist, Economics Research Group, Reis, New York City, USA






More information about the Python-list mailing list