Reusing code from different IPython notebooks

前端 未结 10 1202
南方客
南方客 2020-12-13 08:52

I am using IPython and want to run functions from one notebook from another (without cutting and pasting them between different notebooks). Is this possible and reasonably e

10条回答
  •  执笔经年
    2020-12-13 09:06

    Here are two additional tips:

    1. You can also run %qtconsole magic directly from the notebook and it will automatically connect to the notebook kernel.

    2. Check out https://github.com/atiasnir/ipnb

      You can use it to import notebook files as if they're standard python modules (I'm the author :-)). Main limitation here is that it will discard magic cells (because it does not use IPython at all) but otherwise it should work fine.

提交回复
热议问题