I am running IPython on Windows 7 x64 with pyreadline installed. If I start a new session and type:
import numpy
nu<TAB>
Then nu
autocompletes to 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):
[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.
IPython and compatible frontends not only can complete your code, but can help you to input a wide range of characters. In particular we allow you to insert a unicode character using the tab completion mechanism.
Enable autocomplete feature To enable code autocomplete in Jupyter Notebook or JupyterLab, you just need to hit the Tab key while writing code. Jupyter will suggest a few completion options.
Simply hit the “Tab” key while writing code. This will open a menu with suggestions. Hit “Enter” to choose the suggestion.
One extremely time-saving feature built into the Bash Shell is the ability to "tab-complete" commands. Simply hit the tab key while you are typing a command, and the shell will automatically finish the command for you. Or, if it is ambiguous, it will provide options (you might have to type tab again).
You have to copy config file for pyreadline to your HOME folder (C:\Users\< username >).
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. 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. Looked in ipythonrc and it should work like I am used to but not. The CTRL-l work though. Will see if it kicks back on. Seem to remember that I had similar trouble before but it worked after some time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With