javascript - 如何在 ipython qtconsole 中打开括号的自动完成

标签 javascript python configuration qtconsole

在我的 jupyter notebook 中,我喜欢括号自动完成。

如果我转到终端并运行 jupyter qtconsole 然后我的控制台打开。是这个版本:

Jupyter QtConsole 4.2.1 Python 2.7.11 |Anaconda 2.1.0 (32-bit)| (default, Dec 6 2015, 18:08:45) Type "copyright", "credits" or "license" for more information.

IPython 4.2.0 -- An enhanced Interactive Python.

在 qtconsole 括号中不会自动完成 - 引号也不会。我可以打开它们吗?

我有以下文件:
/home/myname/.jupyter/custom/custom.js
/home/jason/.ipython/profile_default/static/custom/custom.js

custom.js 中,我有以下内容 - 我可以添加到这些文件中以获得自动完成行为吗?

// leave at least 2 line with only a star on it below, or doc generation fails
/**
 *
 *
 * Placeholder for custom user javascript
 * mainly to be overridden in profile/static/custom/custom.js
 * This will always be an empty file in IPython
 *
 * User could add any javascript in the `profile/static/custom/custom.js` file
 * (and should create it if it does not exist).
 * It will be executed by the ipython notebook at load time.
 *
 * Same thing with `profile/static/custom/custom.css` to inject custom css into the notebook.
 *
 * Example :
 *
 * Create a custom button in toolbar that execute `%qtconsole` in kernel
 * and hence open a qtconsole attached to the same kernel as the current notebook
 *
 *    $([IPython.events]).on('app_initialized.NotebookApp', function(){
 *        IPython.toolbar.add_buttons_group([
 *            {
 *                 'label'   : 'run qtconsole',
 *                 'icon'    : 'icon-terminal', // select your icon from http://fortawesome.github.io/Font-Awesome/icons
 *                 'callback': function () {
 *                     IPython.notebook.kernel.execute('%qtconsole')
 *                 }
 *            }
 *            // add more button here if needed.
 *            ]);
 *    });
 *
 * Example :autoCloseBrackets: true,
 *
 *  Use `jQuery.getScript(url [, success(script, textStatus, jqXHR)] );`
 *  to load custom script into the notebook.
 *
 *    // to load the metadata ui extension example.
 *    $.getScript('/static/notebook/js/celltoolbarpresets/example.js');
 *    // or
 *    // to load the metadata ui extension to control slideshow mode / reveal js for nbconvert
 *    $.getScript('/static/notebook/js/celltoolbarpresets/slideshow.js');
 *
 *
 * @module IPython
 * @namespace IPython
 * @class customjs
 * @static
 */

最佳答案

我正在使用这个版本

Jupyter QtConsole 4.3.0 Python 3.6.1 |Anaconda 4.4.0(64 位)| (默认,2017 年 5 月 11 日,13:25:24)[MSC v.1900 64 位 (AMD64)]

自动完成功能在 Windows 上对我来说效果很好。 尝试按 Tab 键,它会显示可用的选项,就像 Linux 一样。

关于javascript - 如何在 ipython qtconsole 中打开括号的自动完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38252268/

相关文章:

python - 使用pyqt5制作简单的聊天机器人,无需按钮

spring-mvc - Spring MVC - Controller 方法没有被调用

javascript - 仅在满足条件时添加下拉切换

javascript - jquery 在点击每个 block 时动态获取类并在 ajax 调用后获得焦点

javascript - Protractor/Jasmine 测试 browser.isElementPresent 在查找类时不起作用

python - 如何过滤单词排列以仅找到语义正确的 ngram? (Python 3,NLTK)

javascript - 如何从 Node.js 主模块访问全局变量?

python - 出现两个窗口而不是一个

c# - ConfigurationManager.RefreshSection ("AppSettings") 不起作用

android - 配置 : error: C compiler cannot create executables when configuring for Android