f = open('C://Users//fireqwert7//Documents//tesis.docx')
sts=''
for line in f:
sts += line
print(sts)
f.close()
给出错误
Traceback (most recent call last):
File "C:\Python32\regularexpressions.py", line 11, in <module>
for line in f:
File "C:\Python32\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 66: character maps to <undefined>
如果可以的话,如果您能告诉我为什么会发生这种情况以及下次如何避免它,我将不胜感激。我讨厌使用我不理解的东西。