程序开头粘贴如下代码即可:
# -*- coding:utf-8 -*- import sys default_encoding = 'utf-8' if sys.getdefaultencoding() != default_encoding: reload(sys) sys.setdefaultencoding(default_encoding)