sys.stdout linebuffered

Benjamin Niemann b.niemann at betternet.de
Wed May 26 09:00:31 EDT 2004


> I start a long running script like this (unix):
> 
> nohup foo.py > foo.log &
> 
> Now Python thinks sys.stdout should not be
> line buffered. How can I force linebuffering?
> 
> I want to see the log file while the script is
> still running. 
> 
> I don't like this solution (Wrapping sys.stdout
> with an own class) 
> 
> http://groups.google.de/groups?hl=de&lr=&ie=UTF-8&selm=u4rz0icqq.fsf%40ctwd0143.fitlinxx.com
> 
> The "-u" switch is not an option.
Even if you use
#!/usr/bin/python -u
in your script?



More information about the Python-list mailing list