【问题标题】:Stand-alone interactive cell for ipython notebookipython notebook 的独立交互式单元
【发布时间】:2015-12-18 09:57:28
【问题描述】:

我作为前 Matlab 用户使用 ipython 笔记本。我想念的一个功能是 matlab 的“命令窗口”——一个单独的交互式窗口,无论您正在编辑脚本的哪个部分,它始终可见。

目前,我在任何我想尝试的地方都创建了一个新单元格,但我无法同时查看这个“原型单元格”和我脚本的任何给定部分,这很烦人。

我的问题:有没有办法在开发环境和 python 脚本的任何给定部分之间快速切换?

欢迎任何解决方案 - 我什至乐于在同一个脚本上打开两个浏览器窗口...

谢谢。

【问题讨论】:

    标签: python matlab user-interface ipython-notebook


    【解决方案1】:

    您可以使用%qtconsole 魔术 - 它会启动一个 qtconsole 附加到与您的笔记本相同的内核。

    https://github.com/ipython/ipython/issues/2593/ 之后,您可以在.jupyter/custom/custom.js 中添加类似以下内容并添加一个按钮来启动qtconsole。

    $([Jupyter.events]).on('notebook_loaded.Notebook', function(){
        // Create a custom button in toolbar that execute `%qtconsole` in kernel
        Jupyter.toolbar.add_buttons_group([
            {
                 'label'   : 'Run QTconsole',
                 'icon'    : 'fa fa-terminal', // select your icon from http://fortawesome.github.io/Font-Awesome/icons
                 'callback': function () {
                     Jupyter.notebook.kernel.execute('%qtconsole')
                 }
            }
            // add more button here if needed.
        ]);
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-06
      • 2011-12-02
      • 2015-11-01
      • 2014-09-17
      • 2019-09-16
      • 1970-01-01
      • 2015-11-18
      • 2015-05-19
      相关资源
      最近更新 更多