from importlib import reload
import sys
import mypackage
reload(sys.modules["mypackage.mymodule"])
reload(sys.modules["mypackage"])
参考
Stack Overflow
Reload component Y imported with 'from X import Y'In Python, once I have imported a module X in an interpreter session using import X, and the module changes on the outside, I can reload the module with reload(...
コメント