I am using Jupyter notebook. In the same folder in which the notebook is running, I have a function f defined as
That automatically loads the in the entire contents of file so that you can edit it in a cell.
from f import f
Is another option.
If neither one of those work for you check out the solution to this question.