当你使用使用python3写好的python程序使用python2运行时,或者在运行你的python程序时,出现了一下错误:
SyntaxError: Non-ASCII character ‘\xe5’ in file figure4_5.py on line 22, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
这是因为程序编码有问题,只需要在你程序开始的地方加入(程序最最顶端)以下代码即可:
#!usr/bin/python
# -*- coding: utf-8 -*-