Python 问题处理:NameError: name 'reload' is not defined
最近碰到的这个“NameError: name ‘reload’ is not defined”问题
因为Python2和Python3这两个版本一些方面的使用上面有很多的不同,Python2中默认把脚本文件使用ASCII来处理,而Python3默认使用utf-8编码,所以使用Python3的时候就没有setdefaultencoding()这个函数。
For Python2:
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultenc
原创
2020-06-29 15:46:17 ·
307 阅读 ·
0 评论