how to “reimport” module to python then code be changed after import

For Python 2.x

reload(foo)

For Python 3.x

import importlib
import foo #import the module here, so that it can be reloaded.
importlib.reload(foo)

Leave a Comment