Created
March 23, 2018 15:25
-
-
Save RobinDavid/68ae562af2dd454fabe566cbcfbeb84e to your computer and use it in GitHub Desktop.
Connecting programmatically (in python) to an existing jupyter kernel (from its file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = "/run/user/1000/jupyter/kernel-7365.json" | |
from jupyter_client.blocking import BlockingKernelClient | |
client = BlockingKernelClient(connection_file=file) | |
client.load_connection_file() | |
client.start_channels() | |
print(client.channels_running) | |
msgid = client.execute("3 + 5") | |
reply = client.get_shell_msg(timeout=3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment