背景zmq-ipython/jupyter内核
background_zmq_ipython的Python项目详细描述
在后台运行一些ipython zmq内核,而不使用交互式shell。 您可以通过zmq远程连接到该内核。
安装(package is on PyPI):
pip install background_zmq_ipython
用法:
import background_zmq_ipython background_zmq_ipython.init_ipython_kernel()
然后,内核将在后台运行在自己的线程中。 init将在stdout上打印类似的消息:
To connect another client to this IPython kernel, use: jupyter console --existing kernel-1111.json
备选方案/相关链接:
- pydbattach
- Twisted SSH (example code)
- IPython.embed_kernel在后台线程中 (example code)。 这有一些问题 (例如here; 乱搞sys.stdoutetc)。
- 此代码是在 this StackOverflow question, 也在这篇IPython GitHub issue #8097中讨论过, 但是它已经过时了,所以这个项目提供了一个重写/更新的代码, 目标也是一个易于安装的pip包。