python 3.x - Dictionary utf-8 encoding -


i have saved dictionary on txt file(its written in greek language):

{'Μπαρτσελόνα': 'Μπαρτσελόνα', 'Οβιέδο': 'Οβιέδο'}

then trying open python:

g = open('dic.txt','r', encoding='utf-8') dic2 = eval(g.read()) g.close() 

but error message:

 ':'Όσιγιεκ','Ζάπρεσιτς':'Ίντερ Ζάπρεζιτς','Σερφίφ':'Σερίφ Τίρασπολ','Μορεϊρένσε':'Μορειρένσε','Κλουζ':'ΚΦΡ Κλουζ',     ^  syntaxerror: invalid character in identifier 

is there problem encoding?


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -