Pythonista reload all modules?
JadedTuna last edited by
Is there a way to reload all the modules, or at least some folder in Pythonista? It is really annoying to restart it, or to use reload() functions everywhere.
Is there some other way?
SpotlightKid last edited by
You might try this somewhat hackish function:
import sys def reload_all(): for name, module in sorted(sys.modules.iteritems()): if hasattr(module, '__file__') and '.' not in name: print "Reloading module '%s'..." % name reload(module)
dgelessus last edited by
Here's an improved version that reloads all modules located in ~/Documents and subfolders, including site-packages: