python中stdout
How to flush the STDOUT buffer in Python so that the content wrote to STDOUT is shown immediately?
如何在Python中刷新STDOUT缓冲区,以便立即显示写入STDOUT的内容?
Call the flush
library function on sys.stdout
which is the STDOUT:
在sys.stdout
上调用flush
库函数(即STDOUT):
import sys
sys.stdout.flush()
From python doc:
从python doc :
flush()
Flush the write buffers of the stream if