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.flush()
パラメータ値
パラメータなし