Auto Reload Python package after making changes in it.

autoreload

IPython extension to reload modules before executing user code.

autoreload reloads modules automatically before entering the execution of code typed at the IPython prompt.


%load_ext autoreload

%autoreload 2

from foo import some_function

some_function()
Out[4]: 42

 # open foo.py in an editor and change some_function to return 43

some_function()
Out[6]: 43

https://ipython.org/ipython-doc/3/config/extensions/autoreload.html


Comments

Popular posts from this blog

Speech Recognition using PyAudio and SpeechRecognition Libraries

Automatically open and do some actions on web pages in python using different packages

open multiple sites in python Script using web browser package