I saw in this useful Q&A that one can use reload(whatever_module)
or, in Python 3, imp.reload(whatever_module)
.
My question is, what if
for python 3.7 :
from importlib import reload #import function "reload"
import YourModule #import your any modules
reload(YourModule) #reload your module
Reload function can be called from your own function
def yourFunc():
reload(YourModule)
import re
for mod in sys.modules.values():
if re.search('name', str(mod)):
reload(mod)