问题描述
在 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).