Juypter笔记本 - 从命令行ipython连接到相同的内核会话?

时间:2017-03-29 03:51:22

标签: ipython jupyter-notebook

假设我在浏览器中加载了一个Jupyter笔记本。有可能以某种方式运行命令行ipython会话连接到与笔记本使用的相同的内核insance(即他们可以看到相同的变量集)?感谢。

1 个答案:

答案 0 :(得分:9)

是的!启动/加载IPython笔记本后,打开终端并使用--existing参数连接命令行ipython会话:

jupyter console --existing

默认情况下,它将连接到最新启动的IPython内核。要选择要连接的其他内核,请在Jupyter笔记本的日志中查找以下行:

[I 09:47:54.462 NotebookApp] Kernel started: 06c9ffae-ae9f-4c22-93c0-4eacf23672b1

要连接到此内核,请执行以下操作:

jupyter console --existing 06c9ffae-ae9f-4c22-93c0-4eacf23672b1
相关问题