我在这个有用的问答中看到了人们可以使用的,reload(whatever_module)或者在Python 3中imp.reload(whatever_module).
reload(whatever_module)
imp.reload(whatever_module)
我的问题是,如果我说from whatever_module import *要导入怎么办?然后我whatever_module在使用时无需参考reload().你们是否会因为将整个模块投入全局命名空间而对我大喊大叫?:)
from whatever_module import *
whatever_module
reload()
python python-module python-import
python ×1
python-import ×1
python-module ×1