How to unbuffer Python's output

Lily Gao Lily.Gao at autodesk.com
Tue Jul 14 00:30:03 EDT 2009


Hi, All
I am calling a python program in perl and use redirection,
Like :
`python x.py > 1.log 2>&1`
When x.py crash, I get nothing from 1.log, and if I don’t use redirection, I can get useful log from the screen.
How can I do to make x.py ‘s  output un-buffered when redirection log to files ,just exactly same with print to the screen?

When I use perl’s $|=1 to unbuffer output, it take no effect. So I think it may be caused by python.
Thanks!

Thanks,
Lily Gao(高雁)
ACRD PSEB Catapult TD
+86-21-38664379

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090713/45488094/attachment.html>


More information about the Python-list mailing list