Jupyter Notebook 4.x DocumentationThis example shows a frontend comm target registered in a registry: Jupyter.notebook.kernel.comm_manager.register_target('my_comm_target', function(comm, msg) { // comm is the frontend comm instance the message # Send data to the frontend comm.send({'foo': 5}) get_ipython().kernel.comm_manager.register_target('my_comm_target', target_func) This example uses the IPython kernel again; this for comms support. And then open the comm from the frontend: comm = Jupyter.notebook.kernel.comm_manager.new_comm('my_comm_target', {'foo': 6}) // Send0 码力 | 128 页 | 1.86 MB | 1 年前3
Jupyter Notebook 4.x DocumentationThis example shows a frontend comm target registered in a registry: Jupyter.notebook.kernel.comm_manager.register_target('my_comm_target', function(comm, msg) { // comm is the frontend comm instance // data in the message # Send data to the frontend comm.send({'foo': 5}) get_ipython().kernel.comm_manager.register_target('my_comm_target', target_func) This example uses the IPython kernel again; this for comms support. And then open the comm from the frontend: comm = Jupyter.notebook.kernel.comm_manager.new_comm('my_comm_target', {'foo': 6}) // Send data comm.send({'foo': 7}) // Register a handler0 码力 | 70 页 | 817.80 KB | 1 年前3
Jupyter Notebook 6.4.10 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 181 页 | 1.87 MB | 1 年前3
Jupyter Notebook 6.4.11 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 183 页 | 1.88 MB | 1 年前3
Jupyter Notebook 6.4.9 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 181 页 | 1.87 MB | 1 年前3
Jupyter Notebook 6.4.12 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 185 页 | 1.88 MB | 1 年前3
Jupyter Notebook 6.4.6 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 181 页 | 1.87 MB | 1 年前3
Jupyter Notebook 6.4.5 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 179 页 | 1.87 MB | 1 年前3
Jupyter Notebook 6.4.8 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 181 页 | 1.87 MB | 1 年前3
Jupyter Notebook 6.4.7 Documentationexample that makes the r key available for running a cell: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', { help : 'run cell', help_index : 'zz', handler : function (event) simply pass a function as the second argument to add_shortcut. [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) { IPython.notebook.execute_cell(); return false; false; }); Likewise, to remove a shortcut, use remove_shortcut: [ ]: %%javascript Jupyter.keyboard_manager.command_shortcuts.remove_shortcut('r'); If you want your keyboard shortcuts to be active for all0 码力 | 181 页 | 1.87 MB | 1 年前3
共 62 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7













