3 ms·
For reloading from within the repl from importlib import reload as r Then in the ipython shell you can type r(module) to reload the entire thing. So I'll
by sitkack 6y ago
For reloading from within the repl
from importlib import reload as r
Then in the ipython shell you can type r(module) to reload the entire thing.
So I'll often have the editor in one terminal window, and ipython in the other one, save the code and switch back the repl, and type r(t)
import mymodule as t
Now tie in some ipdb [1] and you have a pretty sweet setup. Also depending on your serving framework it might also have hot reloading as well, tornado, flask, etc.
[1] https://github.com/gotcha/ipdb https://github.com/gotcha/ipdb
[2] https://www.tornadoweb.org/en/stable/autoreload.html https://www.tornadoweb.org/en/stable/autoreload.html https://werkzeug.palletsprojects.com/en/0.14.x/serving/ https://werkzeug.palletsprojects.com/en/0.14.x/serving/