python默认的编码是ascii,当程序中出现非ascii编码时,python的处理常常会报这样的错,python没办法处理非ascii编码的,

此时需要自己设置python的默认编码,一般设置为utf8的编码格式。

cat myutf8.py #添加如下内容,设置编码为utf8
# encoding=utf8 
import sys

reload(sys) 
sys.setdefaultencoding('utf8')

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-09-19
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-10-24
  • 2021-07-07
相关资源
相似解决方案