I am working on a frontend to IPython in C++ (Qt).
I managed to embed Python in my application and retrieve plots and show these in my GUI. Now I want to start an IPython kernel and connect to it through ZMQ sockets.
I found a description for the communication protocol with IPython kernels. However, it doesn't say anywhere which ports to connect to. So it's nice and dandy to have a communication protocol, but totally useless if I don't know which ports to use.
The documentation mentions 'kernel specs' and tells me to use the jupyter kernelspec list
command. This indeed shows me one directory, which only contains two files: logo-32x32.png and logo-64x64.png ...
How do I find the ports I need to connect to, to communicate with my IPython kernels?
I start my IPython kernel by running the following Python code from my C++ Qt app:
import IPython
IPython.start_kernel(argv=[])
ipy_repl.py
from the SublimeREPL plugin for the Sublime Text programming editor. There's no Sublime-specific API stuff in there. Basically, it works with IPython up to 4.1.1 and jupyter_console up to 4.1.0 (it doesn't seem to work with later versions of IPython 4 or any version of 5) to set up a connection in a Sublime view with a running IPython/Jupyter kernel, including utilizing its autocomplete capability. – Receivestart_kernel
starts a kernel in the current process. What it sounds like you want is a kernel in a separate process which you connect to from your application process. For that, you'd use the jupyter_client module. You could look at applications like Spyder to see what they do. – Ginkgo