Python Tab Completion

Tue 29 October 2013

Add this to your PYTHONSTARTUP (ex: ~/.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…