SyntaxError: Non-ASCII character #-*- coding:utf-8 -*-

执行python报错
/usr/bin/python2.7 /root/demo.py
File "/root/demo.py", line 2
SyntaxError: Non-ASCII character 'xe5' in file /root/demo.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Process finished with exit code 1

在程序第一行添加

#-*- coding:utf-8 -*-

原文地址:https://www.cnblogs.com/tree1123/p/13453509.html