How to manage and communicate with multiple IPython/Jupyter kernels from a Python script? -
i want mimic functionality of notebook server, , instead coordinate creation/management of different ipython/jupyter kernels central body of logic (i.e. own python script).
for example, want to:
- define abstract command e.g. "add(x, y)"
- communicate abstract command multiple kernels e.g. ipython kernel , scala kernel
- have each kernel execute command wish
- return result each kernel central body of logic
can point me in direction of how programmatically start/stop/communicate multiple ipython/jupyter kernels?
a kernelmanager deals starting , stopping single kernel, , there's multikernelmanager co-ordinate more 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 can use .client()
method kernelclient instance handles communications kernel:
for details of how communicate kernel, see message spec docs. of abstracted away kernelclient, you'll need know of it.
Comments
Post a Comment