小凯2013 发表于 2022-5-7 18:43:06

为啥报错??????????????????????????????????....

>>> f = open('C:\\Users\\Administrator\\Desktop\\汉诺塔.py')
>>> f
<_io.TextIOWrapper name='C:\\Users\\Administrator\\Desktop\\汉诺塔.py' mode='r' encoding='cp936'>
>>> for i in f:
        print(i)

       
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
    for i in f:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 480: illegal multibyte sequence为啥报错???不懂。
页: [1]
查看完整版本: 为啥报错??????????????????????????????????....