File "1.py", line 2SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details 原因是:Python默认是以ASCII作为编码方式的,需要在文件开头设置一下编码 # -*- coding: UTF- -*- 或者 #coding=utf-…
本文由荒原之梦原创,原文链接:http://zhaokaifeng.com/?p=686 具体报错内容: File "1.py", line 6 SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 6, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details 报错分析: 上述报错是由于编码格式不匹配导致程序不能识别程…