From a jupyter notebook, I'd like to call a function written in another .ipynb
file. The partial answer is given in this thread Reusing code from different IPython notebooks by drevicko. As an example, I'm using plus_one
function written in plus_one.ipynb
:
def plus_one(x):
print(x + 1)
Then, in my current notebook, I execute the cell:
%run plus_one.ipynb 3
which gives me no output. My expected output is 4
. How to pass an argument (3
) to this script? Thanks!