|
运行出错显示
Traceback (most recent call last):
File "/Users/yedaoguang/Desktop/lessonpy/readfile.py", line 2, in <module>
for each_line in file:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 0: invalid start byte
这个我应该怎么改code
已获得悬赏 10 C币最佳答案
"OpenMe.mp3" 是个文本文件,之所以出错是因为其中包含有中文字符。
改成下面这样就可以了:
本帖寻求最佳方案
1970-1-1 08:00发表回复被阿啦CP采纳,幸运的获得奖励 C币 5
详细答案»
|
|