Skip to content

Instantly share code, notes, and snippets.

@ivanrad
Created May 6, 2013 01:39
Show Gist options
  • Save ivanrad/5522904 to your computer and use it in GitHub Desktop.
Save ivanrad/5522904 to your computer and use it in GitHub Desktop.
Enable tab completion for interactive Python (PYTHONSTARTUP script)
# 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