When I run this code on Juyputer notebook it creates a list and gets rid of the UTF-8 BOM at the start of the file. But when I run it in Python3.6 on eclipse it throws up this error.
File "C:\Users\msjho\eclipse-workspace\MITX\src\root\nested\parsertext.py", line 10, in <module>
print(stuff)
File "C:\Users\msjho\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 1897-1898: character maps to <undefined>
The file is a plain/text file downloaded from google drive where it has undergone optical character recognition to take the text from a .png file
I have been only coding a month or so I may be doing something daft
with open('D:/MarketAppData/procScreencaps/2019_01_28_04_15_24.txt','r', encoding ="UTF-8") as read_file1:
stuff =read_file1.read()
stuff=stuff.split()
if stuff[0].isalnum() == False:
stuff.pop(0)
print(stuff)