Python 文件 flush() 方法

实例

您可以在写入文件时清除缓冲:

f = open("myfile.txt", "a")
f.write("Now the file has one more line!")
f.flush()
f.write("...and another one!")

运行实例

定义和用法

flush() 方法清除内部缓冲。

语法

file.fileno()

参数值

无参数。


http://www.vxiaotou.com