Created
May 6, 2013 01:39
-
-
Save ivanrad/5522904 to your computer and use it in GitHub Desktop.
Enable tab completion for interactive Python (PYTHONSTARTUP script)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PYTHONSTARTUP=~/.pythonrc | |
# | |
# Enable tab completion for interactive python | |
try: | |
import readline | |
import rlcompleter | |
except ImportError: | |
pass | |
else: | |
if 'libedit' in getattr(readline, '__doc__', ''): | |
readline.parse_and_bind('bind ^I rl_complete') | |
else: | |
readline.parse_and_bind('tab: complete') | |
del readline, rlcompleter | |
# vim: expandtab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment