import importlib, MyModule
importlib.reload(MyModule)
from MyModule import *
from MyModule import MyFunction

 

import sys, importlib
importlib.reload(sys.modules['foo'])
from foo import bar

 

#References

https://stackoverflow.com/questions/7271082/how-to-reload-a-modules-function-in-python

 

How to reload a module's function in Python?

Following up on this question regarding reloading a module, how do I reload a specific function from a changed module? pseudo-code: from foo import bar if foo.py has changed: reload bar

stackoverflow.com

https://wikidocs.net/13982

'LANGUAGE > Python' 카테고리의 다른 글

Statistical Visualization or Data Visualization  (0) 2019.08.23
Python Tutorials  (0) 2019.08.23
How to check whether a variable exists or not?  (0) 2019.08.01
Screen Record via CV2 and MSS  (0) 2019.07.30
Send Telegram Message via Telegram Bot  (0) 2019.07.16

+ Recent posts