简体   繁体   English

Windows上的iPython中不明确的制表符完成不起作用

[英]Ambiguous tab completion not working in iPython on Windows

I am running IPython on Windows 7 x64 with pyreadline installed. 我在装有pyreadline的Windows 7 x64上运行IPython。 If I start a new session and type: 如果我开始一个新的会话并键入:

import numpy
nu<TAB>

Then nu autocompletes to numpy . 然后nu自动完成为numpy However, if I start a new session and try this: 但是,如果我开始一个新的会话并尝试以下操作:

import numpy
n<TAB>

Then nothing happens. 然后什么也没有发生。 I would expect it to cycle through all of the possible completions. 我希望它会循环完成所有可能的完成。 I'm currently using out of the box config, do I need to change a setting to enable ambiguous tab completion or am I just out of luck? 我当前正在使用开箱即用的配置,是否需要更改设置以启用不明确的制表符完成功能?还是我不走运?

EDIT : To address the comment from ma3204, here is another example (start with fresh ipython session): 编辑 :为了解决来自ma3204的评论,这是另一个示例(从新的ipython会话开始):

[In 1]: value1 = 5

[In 2]: value2 = 6

[In 3]: va<TAB>       ... nothing happens
[In 3]: va<Ctrl + l>
vars   value2 value1

[In 3]: val<TAB>      ... completes to 'value'
[In 3]: value
[In 3]: value<Ctrl + l>
value2 value1

[In 3]: value

When I type va<TAB> above I would expect each tab press to cycle through value1 , value2 , vars , value1 , value2 , etc. 当我在上面键入va<TAB> ,我希望每次按va<TAB>都可以循环遍历value1value2varsvalue1value2等。

You have to copy config file for pyreadline to your HOME folder (C:\\Users\\< username >). 您必须将pyreadline的配置文件复制到您的HOME文件夹(C:\\ Users \\ <用户名>)。

Open Command line and execute that: 打开命令行并执行:

copy "C:\Program Files (x86)\Python26\Lib\site-packages\pyreadline\configuration\pyreadlineconfig.ini" %HOMEPATH%

Just installed python 2.6 and numpy, ipython and so on. 刚刚安装了python 2.6和numpy,ipython等。 I am also annoyed of this. 我对此也感到恼火。 On my other computers with older installations it works. 在其他安装较旧版本的计算机上,它可以正常工作。 I use the completions list very much to see what commands are available so I feel frustrated when it doesn't work. 我非常使用补全列表来查看可用的命令,因此当它不起作用时我会感到沮丧。

EDIT: Found that you can get it with CTRL-l. 编辑:发现您可以使用CTRL-l获得它。 Looked in ipythonrc and it should work like I am used to but not. 在ipythonrc中查看,它应该像我以前那样工作,但不是。 The CTRL-l work though. CTRL-l可以工作。 Will see if it kicks back on. 会看看它是否重新开始。 Seem to remember that I had similar trouble before but it worked after some time. 似乎还记得我之前也遇到过类似的麻烦,但是一段时间后仍然有效。

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

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