UTF-8 支持中文编码
ANSI 默认不支持
把Python文件写在桌面上
Windows操作环境 cd Desktop
python Hello World.py
桌面上:HelloWorld.py
C:\Users\souke\Desktop>python helloworld.py
HelloWorld
C:\Users\souke\Desktop>
C:\Users\souke\Desktop>python helloworld.py
File "hellowrold.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xal' in file hellowrold.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
C:\Users\souke\Desktop>
print("你好,python世界")
支持中文,需要更改编码格式:
格式---转为 UTF-8 编码格式