First of all, you should know what encoding is. Read the Absolute Minimum Every software developer should absolutely, be positively aware of Unicode and character sets (no excuses!) .
Now the problem is that most people write code in ASCII. Roughly speaking, this means that they use Latin letters, numbers and basic punctuation only in the code files themselves. It seems you used non-ASCII character code inside your program, which confuses Python.
There are two ways to fix this. Firstly, you need to tell Python what encoding you would like it to read the text file. You can do this by adding the # coding declaration at the top of the tile. The second and probably better is to limit yourself to ASCII code. Remember that you can always have any characters that you like inside strings by writing them in their encoded form, for example. \x00 or something else.
source share