|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
求大神帮帮忙!!!!!谢谢
python入门28的作业 打开MP3我直接下载,复制了代码也不能直接打开文件
报错如下
Traceback (most recent call last):
File "C:/Users/18190/Desktop/python/28/读文件.py", line 2, in <module>
for each_line in f:
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'CP_UTF8' codec can't decode byte 0xb3 in position 0: No mapping for the Unicode character exists in the target code page.
>>>
再试试这个:
f = open('OpenMe.mp3', encoding='cp936')
|
|