file函数

来源:互联网 发布:92式重机枪 知乎 编辑:程序博客网 时间:2024/06/06 06:50
file(name[mode[buffering]])

Constructor function for the file type, described further in section File Objects. The constructor’s arguments are the same as those of the open() built-in function described below.

When opening a file, it’s preferable to use open() instead of invoking this constructor directly. file is more suited to type testing (for example, writing isinstance(f, file)).

原创粉丝点击