用户登录
用户注册

分享至

close() 在 Python 中是否暗示 flush()?

  • 作者: 丿樱花灬
  • 来源: 51数据库
  • 2022-11-30

问题描述

在 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).

软件
前端设计
程序设计
Java相关