autoreload
noun
say it: “AW-toh-ree-lohd” /ˈɔtoʊriˌloʊd/
A notebook tool that loads a changed Python file again before each cell runs, so your edits take effect.
What does autoreload do in a notebook?
autoreload is a tool of the notebook's kernel that loads a changed module again before each cell runs. Without
it, a function you fixed in a .py file keeps giving its old answer until the kernel restarts, because Python imports
a module only once.
%load_ext autoreload
%autoreload 2
import analysis # edits to analysis.py now reach the next cell you run
In a sentence
- “She turned on autoreload in the notebook's first cell.”
- “With autoreload on, the fixed function gave the new answer.”
Level: Journeyman · More Python terms at this level
Updated