from mypackage.pkg import mymodule
...
reload(mypackage.pkg.mymodule)
results in NameError: global name 'mypackage' is not defined.
结果为NameError:未定义全局名称“mypackage”。
How should mymodule be reloaded?
如何重新加载mymodule?
1 个解决方案
#1
8
from mypackage.pkg import mymodule
reload(mymodule)
or
要么
import mypackage.pkg.mymodule
...
reload(mypackage.pkg.mymodule)
#1
8
from mypackage.pkg import mymodule
reload(mymodule)
or
要么
import mypackage.pkg.mymodule
...
reload(mypackage.pkg.mymodule)