Python 打开文件
如何打开文件?
Python 中打开文件有两种基本方法:
使用 open() 函数
open() 函数用于打开一个文件,并返回一个文件对象。文件对象代表文件的句柄,可用作其他文件操作。
语法:
<code class="<a style=\'color:#f60; text-decoration:underline;\' href=" https: target="_blank">python">file_object = open(filename, mode)