Last active
July 7, 2023 09:57
-
-
Save simonreeves/d29660465435ece3996798aa43a0b328 to your computer and use it in GitHub Desktop.
python 2 or 3 module reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
# import method depends on python version | |
if sys.version_info.major > 2: | |
import importlib | |
importlib.reload(my_module) | |
else: | |
reload(my_module) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment