简体   繁体   English

如何在ipython qtconsole中启用括号的自动完成功能

[英]How to turn on auto-complete of brackets in ipython qtconsole

In my jupyter notebook the brackets auto-complete which I like. 在我的jupyter笔记本中,括号自动完成我喜欢的。

If I go to the terminal and run jupyter qtconsole then my console opens. 如果我去终端并运行jupyter qtconsole那么我的控制台就会打开。 It is this version: 这是这个版本:

Jupyter QtConsole 4.2.1 Python 2.7.11 |Anaconda 2.1.0 (32-bit)| Jupyter QtConsole 4.2.1 Python 2.7.11 | Anaconda 2.1.0(32位)| (default, Dec 6 2015, 18:08:45) Type "copyright", "credits" or "license" for more information. (默认,2015年12月6日,18:08:45)输入“copyright”,“credits”或“license”以获取更多信息。

IPython 4.2.0 -- An enhanced Interactive Python. IPython 4.2.0 - 增强的交互式Python。

In the qtconsole brackets do not autocomplete - neither do quotation marks. 在qtconsole括号中不自动完成 - 也没有引号。 Can I turn them on? 我可以打开它们吗?

I have the following files: 我有以下文件:
/home/myname/.jupyter/custom/custom.js
/home/jason/.ipython/profile_default/static/custom/custom.js

In custom.js I have the below - can I add to these files to get the autocomplete behaviour? 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
 */

I am using this version 我正在使用这个版本

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

and autocomplete works fine for me on windows. 和自动完成在Windows上对我来说很好。 Try pressing tab it will show you available options, just like linux. 尝试按Tab键,它会显示可用的选项,就像linux一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM