解决:SyntaxError: Non-ASCII character ‘\xe8‘ in file 1.py on line 3, but no encoding declared; see htt

报错:

SyntaxError: Non-ASCII character ‘\xe8’ in file 1.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

原因:缺少编码格式

解决方法:

在Python文件添加开头:#encoding:utf-8

你可能感兴趣的:(Linux,python,linux)