1 reload(sys)
2 sys.setdefaultencoding("utf-8")

在Python 3.x中不好使了 提示 name ‘reload’ is not defined

sys.setdefaultencoding(“utf-8”) 这种方式在Python3.x中被彻底遗弃

在Python 3.x中被替换为

1 import importlib
2 importlib.reload(sys)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
相关资源
相似解决方案