Python 初学笔记:不支持中文字符?

时间:2021-07-17 07:10:20
 
'''Created on 20140311初学笔记@author: Sinjon'''print("Hello, Python.")

Debug 时出现报错:

SyntaxError: Non-ASCII character '\xb3' in file C:\Users\workspace\HelloPython\HelloPython.py on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

去掉中文字符“初学笔记”,重新调试,一切OK

百度其他解决方法,发现只需要指定编码方式就行了

#-*-coding: cp936-*-
具体参见:
点击打开链接