4 ms·
You likely want to use something like https://github.com/jupyter/jupyter_console https://github.com/jupyter/jupyter_console, or ipykernel directly to have a per
by carreau 5y ago
You likely want to use something like https://github.com/jupyter/jupyter_console https://github.com/jupyter/jupyter_console, or ipykernel directly to have a persistent python process. One issue is that shells are text based, so you have to do a lot of serialisation/deserialisation.
But honestly at that point I would just look into https://xon.sh/ https://xon.sh/ that blends Python and Shell together. IPython and Xonsh devs are friends, so if you need anything from one into the other it's likely doable.
- jarpineh 5y agoThing is, I like my zsh. Sometimes I use Nu shell as well, which does structured data better. Serialization I think needs to happen anyway to get data into IPython from outside. I have tried Xonsh once or twice, but it was too large change. Unix shell does some things very well, Python I like to use for other things. It is the crossover I’d like to smooth out. I am confused on what having a persistent Python process means in this context. Isn’t IPython already that? Jupyter console states it’s a single process IPython terminal. That does leave me wondering what is different when I start IPython vs Jupyter console. I might have assumed years ago that they are mutually exclusive…
- carreau 5y agoWell, jupyter_console itself is a frontend/CLI, it starts another process (ipykernel) and communicate with it using ZMQ. IPykernel itself use IPython as a library to execute code. It might be easier to send code to an ipykernel started with jupyter_console, as it already has an eventloop and is listening to sockets, that trying to talk to an IPython. Plus using ZMQ you'll have richer messages than just text.
- jarpineh 5y agoOk. Thank you for the hints. And your work on IPython. It is very much appreciated.