It looks like you want to want to reload an already loaded module. You can use the reload function from the importlib library.
E.g:
import foo
from importlib import reload
while True:
if is_changed(foo):
foo = reload(foo)
please note that the above code will work only for python 3.4 and above for python 3.0 to 3.3 import imp instead of import importlib