Jupyter Notebook 5.2.2 DocumentationMessages The messaging specification section on comms 3.1 Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs _target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message, which can carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); }); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm is registered, you can open the comm from the kernel: from ipykernel.comm import Comm # Use comm to send a0 码力 | 129 页 | 1.73 MB | 1 年前3
Jupyter Notebook 5.0.0 Documentationhtml#custom-messages] The messaging specification section on comms Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs registered in a registry: Jupyter.notebook.kernel.comm_manager.register_target('my_comm_target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm0 码力 | 184 页 | 4.40 MB | 1 年前3
Jupyter Notebook 5.1.0 Documentationhtml#custom-messages] The messaging specification section on comms Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs registered in a registry: Jupyter.notebook.kernel.comm_manager.register_target('my_comm_target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm0 码力 | 184 页 | 4.36 MB | 1 年前3
Jupyter Notebook 5.1.0 DocumentationMessages The messaging specification section on comms 3.1 Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs _target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message, which can carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); }); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm is registered, you can open the comm from the kernel: from ipykernel.comm import Comm # Use comm to send a0 码力 | 128 页 | 1.72 MB | 1 年前3
Jupyter Notebook 5.0.0 DocumentationMessages The messaging specification section on comms 3.1 Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs _target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message, which can carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); }); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm is registered, you can open the comm from the kernel: from ipykernel.comm import Comm # Use comm to send a0 码力 | 129 页 | 1.76 MB | 1 年前3
Jupyter Notebook 5.2.2 Documentationhtml#custom-messages] The messaging specification section on comms Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs registered in a registry: Jupyter.notebook.kernel.comm_manager.register_target('my_comm_target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm0 码力 | 183 页 | 4.36 MB | 1 年前3
Jupyter Notebook 5.4.1 DocumentationMessages The messaging specification section on comms 3.1 Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs _target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message, which can carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); }); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm is registered, you can open the comm from the kernel: from ipykernel.comm import Comm # Use comm to send a0 码力 | 134 页 | 1.77 MB | 1 年前3
Jupyter Notebook 5.5.0 Documentationthe output area. In [6]: print("hi, stdout") hi, stdout In [7]: from __future__ import print_function print('hi, stderr', file=sys.stderr) hi, stderr 3.3.6 Output is asynchronous All output is displayed keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) { IPython.notebook.execute_cell(); return false; }} ); “By default the keypress r, while field, you can simply pass a function as the second argument to add_shortcut. In [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell();0 码力 | 143 页 | 1.81 MB | 1 年前3
Jupyter Notebook 5.4.0 DocumentationMessages The messaging specification section on comms 3.1 Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs _target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message, which can carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); }); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm is registered, you can open the comm from the kernel: from ipykernel.comm import Comm # Use comm to send a0 码力 | 134 页 | 1.77 MB | 1 年前3
Jupyter Notebook 5.3.1 DocumentationMessages The messaging specification section on comms 3.1 Opening a comm from the kernel First, the function to accept the comm must be available on the frontend. This can either be specified in a requirejs _target', function(comm, msg) { // comm is the frontend comm instance // msg is the comm_open message, which can carry data // Register handlers for later messages: comm.on_msg(function(msg) {...}); }); comm.on_close(function(msg) {...}); comm.send({'foo': 0}); }); Now that the frontend comm is registered, you can open the comm from the kernel: from ipykernel.comm import Comm # Use comm to send a0 码力 | 133 页 | 1.77 MB | 1 年前3
共 62 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7













