python2 报错:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128)

解决方法:

import sys
if sys.getdefaultencoding() != 'utf-8':
    reload(sys)
    sys.setdefaultencoding('utf-8')

  

posted @ 2018-03-08 15:31  那时的吻狠陶醉  阅读(600)  评论(0编辑  收藏  举报