Shorter Hacks 16: IPython Autoreload
When developing some python code and testing it in IPython, I love the
autoreload
feature of IPython. When enabled it will reload imported modules automatically. So you will always use the newest version of your code. It even patches modifications on class methods into existing class instances. To enable it first load it with%load_ext autoreload
, then enable it with%autoreload 2
– See the documentation for explanations of the options and how to autoreload only selected imports.
Source: Shorter Hacks 16 IPython Autoreload, an article by Michael F. Schönitzer.