快乐学习 一个网站喵查铺子(catpuzi.com)全搞定~

文件“静夜思.txt”的编码为“utf-8”,现在需要读取文件内容,打开这个文件并创建文件对象file的正确语句为:

题目:文件“静夜思.txt”的编码为“utf-8”,现在需要读取文件内容,打开这个文件并创建文件对象file的正确语句为:

with open(“静夜思.txt”,’r’,encoding=’utf-8′) as file:
with open(“静夜思.txt”,’r’,encoding=’GBK’) as file:
file = open(“静夜思.txt”,’r’,encoding=’utf-8′) as file:
file = open(“静夜思.txt”,’w’,encoding=’GBK’) as file:

喜欢 (0)
关于作者: