只需%qtconsole
在一个单元中执行,它就会启动一个附加到同一内核的 qtconsole。当然,您的内核需要是本地的。
您当然可以使用 long 方法:
In [1]: %connect_info
{
"stdin_port": 50845,
"ip": "127.0.0.1",
"control_port": 50846,
"hb_port": 50847,
"signature_scheme": "hmac-sha256",
"key": "c68e7f64-f764-4417-ba3c-613a5bf99095",
"shell_port": 50843,
"transport": "tcp",
"iopub_port": 50844
}
Paste the above JSON into a file, and connect with:
$> ipython <app> --existing <file>
or, if you are local, you can connect with just:
$> ipython <app> --existing kernel-45781.json
or even just:
$> ipython <app> --existing
if this is the most recent IPython session you have started.
然后
ipython qtconsole --existing kernel-45781.json