可按照錯誤建議網址查看http://www.python.org/peps/pep-0263.html
發現是因為Python在默認狀態下不支持源文件中的編碼所致。解決方案有如下三種:
一、在文件頭部添加如下注釋碼:
# coding=<encoding name> 例如,可添加# coding=utf-8
二、在文件頭部添加如下兩行注釋碼:
#!/usr/bin/python
# -*- coding: <encoding name> -*- 例如,可添加# -*- coding: utf-8 -*-
三、在文件頭部添加如下兩行注釋碼:
#!/usr/bin/python
# vim: set fileencoding=<encoding name> : 例如,可添加# vim: set fileencoding=utf-8 :