error
执行python报错
SyntaxError: Non-ASCII character ‘\xe6’ in file xxx.py on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
reason
代码中存在中文注释
resolution
在文件第一行添加
# encoding=utf-8
执行python报错
SyntaxError: Non-ASCII character ‘\xe6’ in file xxx.py on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
代码中存在中文注释
在文件第一行添加
# encoding=utf-8