JadedTuna
Aug 28, 2014 - 19:29
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?
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?
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)
Here's an improved version that reloads all modules located in ~/Documents and subfolders, including site-packages:
http://github.com/dgelessus/pythonista-scripts/blob/master/reload_all.py