Python File flush方法应用


 # flush()使用
 !/usr/bin/python
 -*- coding: UTF-8 -*-

#  打开文件
fo = open("runoob.txt", "wb")
print("文件名为: ", fo.name)

#  刷新缓冲区
fo.flush()

#  关闭文件
fo.close()

纵有疾风起,人生不言弃!
原文地址:https://www.cnblogs.com/poetl/p/8127118.html