在Jupyter笔记本中选择run all
、run all above
或run all below
后,如何跳转到单元格当前正在运行?
最佳答案
谢谢你的想法,Aaron。但它只能在完整运行时运行一次,因此需要对其进行改进以使其更有用。
我把它扩展成一个快捷方式,可以在笔记本的执行过程中多次使用。
将此添加到 ~/.jupyter/custom/custom.js
:
// Go to Running cell shortcut
Jupyter.keyboard_manager.command_shortcuts.add_shortcut('Alt-I', {
help : 'Go to Running cell',
help_index : 'zz',
handler : function (event) {
setTimeout(function() {
// Find running cell and click the first one
if ($('.running').length > 0) {
//alert("found running cell");
$('.running')[0].scrollIntoView();
}}, 250);
return false;
}
});
现在您可以随时按 Alt-I
让笔记本将 View 重新聚焦到正在运行的单元格上。
接下来最好编写一个扩展/快捷方式,使当前运行的单元格的 View 在所有执行过程中始终处于焦点状态。
关于python - 如何跳转到 Jupyter Notebook 中当前正在运行的单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44273643/