Created
June 18, 2013 09:20
-
-
Save csaez/5803915 to your computer and use it in GitHub Desktop.
Handy function to fully reload a module by name
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 | |
def hard_reload(name): | |
for k in sys.modules.keys(): | |
if k.startswith(name): | |
del sys.modules[k] | |
if __name__ == "__main__": | |
for name in sys.argv[1:]: | |
hard_reload(name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment