Jul-24-2020, 08:30 AM
Hello,
I try to write program who will find the word in the file.
Traceback (most recent call last):
File "C:/Users/andrz/PycharmProjects/selenium/New.py", line 3, in <module>
for line in new:
File "C:\Users\andrz\AppData\Local\Programs\Python\Python38-32\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 0x81 in position 637: character maps to <undefined>
What should I do?
I try to write program who will find the word in the file.
new=open(r'C:\Users\andrz\Desktop\New folder (3)\New.docx') for line in new: line=line.rstrip() if not 'But' in line: continue print(line)I have this Error:
Traceback (most recent call last):
File "C:/Users/andrz/PycharmProjects/selenium/New.py", line 3, in <module>
for line in new:
File "C:\Users\andrz\AppData\Local\Programs\Python\Python38-32\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 0x81 in position 637: character maps to <undefined>
What should I do?