Closed aisharing closed 6 years ago
Python version: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AM D64)] on win32
The error I met was caused by the code I wrote in Sublime Text 3, there is no encoding for Chinese charactor, after I wrote the same code in Notepad++ and set the encoding with GB2312, the Hello.py could be run as normal:
print("你好,世界")
C:\Users\Idea>python E:\learning\Python\Hello_02.py 你好,世界
I totally wrote as the "Hello.py", but met the following error: SyntaxError: Non-ASCII character '\xe4' in file E:\Program Files\Learning\Python\Hello.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ f or details