python - 如何跳转到 Jupyter Notebook 中当前正在运行的单元格?

标签 python jupyter-notebook

在Jupyter笔记本中选择run allrun all aboverun 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/

相关文章:

python - 如何在禁用 webdriver 和 quic 的情况下启动 Chrome?

python - 通过 FEniCS 求解热方程

python - 在 Python 2.7 中使用 Unicode 转义时出现奇怪的问题

python - 将变量从 Jupyter notebook 传递到 python 脚本

python - Pyomo:从 Python 代码访问解决方案

python - 使用虚拟环境会影响 Web 应用程序的性能吗?

python - 带和不带笔记本的 IPython 差异

python - 无法在 python jupyter 笔记本中使用 ggplot2

r - 在R Jupyter笔记本中显示文件中的图像

python - 使用conda安装第三方包