Skip to content

Instantly share code, notes, and snippets.

@skinp
Last active December 10, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skinp/4504517 to your computer and use it in GitHub Desktop.
Save skinp/4504517 to your computer and use it in GitHub Desktop.
Enabling tab completion in default python interpreter

Add this to your PYTHONSTARTUP (~/.pythonrc.py) file:

try:
    import readline
except ImportError:
    print "Module readline not available."
else:
    import rlcompleter
    readline.parse_and_bind("tab: complete")

then:

export PYTHONSTARTUP=~/.pythonrc.py
python

or add PYTHONSTARTUP entry to your shell profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment