Running a Jupyter notebook from another notebook

后端 未结 1 883
滥情空心
滥情空心 2021-02-02 09:01

I wonder if it is possible to run a *.ipynb file from another *.ipynb file and get a returned value. I know that we can run like this:

%run ./called_notebook.ipy         


        
相关标签:
1条回答
  • 2021-02-02 09:52

    I'd suggest running the foo function from the new notebook. In other words:

    %run ./called_notebook.ipynb
    foo()
    

    In my opinion, this is best practices for using the %run magic command. Store your high level APIs in a separate notebook (such as foo), but keep your function calls visible in the master notebook.

    0 讨论(0)
提交回复
热议问题