错误提示1:
SyntaxError: Non-ASCII character '\xe2' in file xx.py on line 12, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
处理方式:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
错误提示2:(来着注释存在汉语的情况)
SyntaxError: Non-ASCII character '\xe7' in file xiaohuakong.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
处理方式:
代码开头加入:
#coding:utf-8