While using non-ASCII characters in your code, you might get this error:
SyntaxError: Non-ASCII character '\xc3' in file myprog.py on line 101, but no encoding declared;
SyntaxError: Non-ASCII character '\xc3' in file myprog.py on line 101, but no encoding declared;
Solution is to define encoding at the beginning of your source code.
Syntax: # -*- coding: desired_encoding -*-
Example: # -*- coding:Utf-8 -*-
For details check http://www.python.org/dev/peps/pep-0263/.
No comments:
Post a Comment