Zalgorithm

Using importlib.reload to reimport modules in the Python REPL

When testing code in the Python REPL, instead of exiting and restarting the REPL each time changes are made to the code, reimport the module with importlib.reload:

In [4]: import importlib

In [5]: import scratch

In [6]: importlib.reload(scratch)
Out[6]: <module 'scratch' from '/home/scossar/sketchbook/mandelbrot_clean/scratch.py'>
Tags: