错误提示
File "test.py", line 2 SyntaxError: Non-ASCII character 'xe4' in file test.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
解决方式
python2
代码首行加入
#!/usr/bin/python # -*- coding: UTF-8 -*-
python3
修改工作环境为UTF-8,并删除之前的文件,重新建立