How to display accents in python?

1

I need to read a file of names in python, but they are full of accents, I'm using this to open

arquivo = open('dadostxt/Nomes.txt', 'r', encoding='utf-8')

I put utf-8 in the encoding, but when I go to excel or give a print, instead of the accents it comes with a question mark, can you solve it?

example of output

{'nome': 'Aid�e Dias', 'idade': 33, 'email': 'Aid�e [email protected]', 'salario': 4473.75}
    
asked by anonymous 30.05.2018 / 00:38

1 answer

2

Try to put this at the beginning of your scheduled, first line:

#encoding: utf-8
    
30.05.2018 / 02:18