2013年8月3日

摘要: test.py:import timewhile 1: print 'a' time.sleep(1)执行python脚本,python test.py > output然后用tailf output查看,却没有内容google了下,是因为stdout默认是buffered I/O,所以是print到缓冲区了有几种办法可以解决这个问题:print之后加sys.stdout.flush()或者python -u test.py,-u参数是强制stdin,stdout,stderr无缓冲 阅读全文

posted @ 2013-08-03 17:35 justff 阅读(1940) 评论(0) 推荐(0) 编辑