|

楼主 |
发表于 2020-2-23 15:23:06
|
显示全部楼层
本帖最后由 飞天大猫 于 2020-2-23 15:35 编辑
文件已经删了啊,等下我重新写个传上来
- >>> a = open("C:\\Users\\test\\Desktop\\Python\\test1.txt")
- >>> a
- <_io.TextIOWrapper name='C:\\Users\\test\\Desktop\\Python\\test1.txt' mode='r' encoding='cp936'>
- >>> a.read()
- Traceback (most recent call last):
- File "<pyshell#106>", line 1, in <module>
- a.read()
- UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 10: illegal multibyte sequence
- >>> a.seek(0)
- 0
- >>> a.readline()
- Traceback (most recent call last):
- File "<pyshell#108>", line 1, in <module>
- a.readline()
- UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 10: illegal multibyte sequence
- >>>
复制代码 |
|