Open NjustWrun opened 3 months ago
$ python server.py
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.
To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.
To read more about this, see https://github.com/ipython/ipython/issues/2049
To connect another client to this kernel, use:
--existing kernel-63911.json
Note the --existing kernel-63911.json
this file can be found (for me) in /Library/Jupyter/runtime
(MacOS).
$ cat kernel-63911.json
{
"shell_port": 57492,
"iopub_port": 57496,
"stdin_port": 57493,
"control_port": 57494,
"hb_port": 57498,
"ip": "127.0.0.1",
"key": "a47f4cd5-f653fa28db142e98b34710a7",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}
So my guess is socket.connect("tcp://127.0.0.1:8888")
is the wrong port.
You want to read about https://jupyter-client.readthedocs.io/ which will give you the right abstractions to talk with a kernel.
examples: server: (Ipython docs examples)
client:
Why can not i connect to ipython with client code above? Can you give me some suggess? Thank you very much