3 ms·
To use tab completion in earlier Python versions: import readline, rlcompleter; readline.parse_and_bind("tab: complete")
by est 14y ago
To use tab completion in earlier Python versions:
import readline, rlcompleter; readline.parse_and_bind("tab: complete")
- gsa 14y agoTo make it seamless, put those lines in ~/.pythonrc and add this to your zshrc export PYTHONSTARTUP="$HOME/.pythonrc"
- niggler 14y agoon OSX you need readline.parse_and_bind('bind ^I rl_complete')
- alexpopescu 14y agoI use a combination of all these 3 tricks as I have my dotfiles shared between Mac and Linux. Basically my pythonstartup.py contains the extra check for os: AP_AUTOCOMPLETE=False import sys try: import readline except ImportError: print "Module readline unavailable" else: import rlcompleter readline.parse_and_bind("tab: complete") if sys.platform == 'darwin': readline.parse_and_bind("bind ^I rl_complete") AP_AUTOCOMPLETE=True