SyntaxError of Non-ASCII character [duplicate] SyntaxError of Non-ASCII character [duplicate] python python

SyntaxError of Non-ASCII character [duplicate]


You should define source code encoding, add this to the top of your script:

# -*- coding: utf-8 -*-

The reason why it works differently in console and in the IDE is, likely, because of different default encodings set. You can check it by running:

import sysprint sys.getdefaultencoding()

Also see: