Python3 基础教程 - 廖雪峰
'Applications', 'Desktop', 'Documents', 'Downloads', 'Library', 'Movies', 'Music', 'Pictures', 'Public', 'VirtualBox VMs', 'Workspace', 'XCode'] for 循环其实可以同时使用两个甚至多个变量,比如 dict 的 items()可以 同时迭代 key 和 value: Python3 CPU,你肯定在想,多核应该可以同时执行多 个线程。 如果写一个死循环的话,会出现什么情况呢? 打开 Mac OS X 的 Activity Monitor,或者 Windows 的 Task Manager,都 可以监控某个进程的 CPU 使用率。 我们可以监控到一个死循环线程会 100%占用一个 CPU。 如果有两个死循环线程,在多核 CPU 中,可以监控到会占用 200%的 CPU,也就是占用两个 5000, 设置验证码'abc': manager = QueueManager(address=('', 5000), authkey=b'abc') # 启动 Queue: manager.start() # 获得通过网络访问的 Queue 对象: task = manager.get_task_queue() result = manager.get_result_queue()0 码力 | 531 页 | 5.15 MB | 1 年前3Jupyter Notebook 4.x Documentation
This 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 年前3Jupyter Notebook 4.x Documentation
This 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 年前3Jupyter Notebook 6.4.10 Documentation
example 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 年前3Jupyter Notebook 6.4.11 Documentation
example 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 年前3Jupyter Notebook 6.4.9 Documentation
example 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 年前3Jupyter Notebook 6.4.12 Documentation
example 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 年前3Jupyter Notebook 6.4.6 Documentation
example 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 年前3Jupyter Notebook 6.4.5 Documentation
example 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 年前3Jupyter Notebook 6.4.8 Documentation
example 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
共 440 条
- 1
- 2
- 3
- 4
- 5
- 6
- 44