Answer the question
In order to leave comments, you need to log in
cp1251.py error?
c = 1
with open(r'C:\Users\AKSHIN\Downloads\errr.txt','r',encoding='utf-8')as f:
z = f.read().split('\n')
print(z)
Answer the question
In order to leave comments, you need to log in
You can handle this exception:
with open(r'C:\Users\AKSHIN\Downloads\errr.txt','r',encoding='utf-8')as f:
z = f.read().splitlines()
for line in z:
try:
print(line)
except UnicodeEncodeError:
pass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question