1import my_module # initial import of my_module
2
3from importlib import reload
4my_module = reload(my_module) # reload of my_module
1from importlib import reload
2import foo
3
4while True:
5 # Do some things.
6 if is_changed(foo):
7 foo = reload(foo)