python reload import module code example
Example: python refresh import
from importlib import reload
import foo
while True:
# Do some things.
if is_changed(foo):
foo = reload(foo)
from importlib import reload
import foo
while True:
# Do some things.
if is_changed(foo):
foo = reload(foo)