Python 文件 flush() 方法实例定义和用法语法参数值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() 参数值无参数。