file_name = input('请输入需要打开的文件名:')f = open(file_name)print('文件的内容是:')for each_line in f: print(each_line)运行之后出现报错如下:请输入需要打开的文件名:1.txt文件的内容是:Traceback (most recent call last): File "C:/Users/涤非/Desktop/test2.py", line 4, in <module> for each_line in f:UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte sequence
添加回答
举报
0/150
提交
取消