How to manage and communicate with multiple IPython/Jupyter kernels from a Python script?

前端 未结 1 1778
无人共我
无人共我 2021-01-05 07:53

I want to mimic the functionality of a notebook server, and instead coordinate the creation/management of different IPython/Jupyter kernels from a central body of logic (i.e

相关标签:
1条回答
  • 2021-01-05 08:36

    A KernelManager deals with starting and stopping a single kernel, and there's a MultiKernelManager to co-ordinate more than one.

    • http://ipython.org/ipython-doc/3/api/generated/IPython.kernel.manager.html
    • http://ipython.org/ipython-doc/3/api/generated/IPython.kernel.multikernelmanager.html

    Then you can use the .client() method to get a KernelClient instance which handles communications with a kernel:

    • http://ipython.org/ipython-doc/3/api/generated/IPython.kernel.client.html

    For details of how you communicate with a kernel, see the message spec docs. Some of this is abstracted away by KernelClient, but you'll probably need to know some of it.

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