在Python中close()是否暗示flush()? [英] does close() imply flush() in Python?
本文介绍了在Python中close()是否暗示flush()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Python中,总的来说-对文件对象执行close()
操作是否暗含flush()
操作?
In Python, and in general - does a close()
operation on a file object imply a flush()
operation?
推荐答案
是.它使用底层的close()
函数为您执行此操作(源).
Yes. It uses the underlying close()
function which does that for you (source).
这篇关于在Python中close()是否暗示flush()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文