python多久刷新一次文件?Python多久刷新一次文件?Python多久刷新一次stdout?我对(1)不确定。至于(2),我相信Python在每一个新行之后都会刷新到stdout。但是,如果您重载stdout到一个文件,它是否经常刷新?
3 回答
森林海
TA贡献2011条经验 获得超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
提交
取消