tkinter and stdout redirection

Randall Hopper aa8vb at yahoo.com
Wed Jan 19 13:47:44 EST 2000


nathan:
 |if I redirect the output stream in a file with
 |
 |sys.stdout = open ("file", "w")
 |
 |direct from the command prompt, I get the output  stream in my file without
 |any problems.
 |
 |But if I do the same from a tkinter application , I get the output stream
 |only when I close the application.
 |
 |I think that there's a buffer between the output stream and my file, but
 |I've not found anywhere how to set it.  Someone can help me?  Thank you

You can execute sys.stdout.flush() every so often.  Or, here's a
slick way to get your file to do it for you:

    http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=531092833

-- 
Randall Hopper
aa8vb at yahoo.com




More information about the Python-list mailing list