python多久刷新一次文件?Python多久刷新一次文件?Python多久刷新一次stdout?我對(1)不確定。至于(2),我相信Python在每一個新行之后都會刷新到stdout。但是,如果您重載stdout到一個文件,它是否經(jīng)常刷新?
3 回答

森林海
TA貢獻(xiàn)2011條經(jīng)驗 獲得超2個贊
#0 means there is no buffer, so all output#will be auto-flushedfsock = open('out.log', 'w', 0)sys.stdout = fsock#do whateverfsock.close()
添加回答
舉報
0/150
提交
取消