Skip to content

Instantly share code, notes, and snippets.

@ryanwoodsmall
Last active January 9, 2019 09:43
Show Gist options
  • Save ryanwoodsmall/72b60ec679e4a1680c7eb7639694afd1 to your computer and use it in GitHub Desktop.
Save ryanwoodsmall/72b60ec679e4a1680c7eb7639694afd1 to your computer and use it in GitHub Desktop.
python-readline-tab-completion.py
# https://stackoverflow.com/questions/246725/how-do-i-add-tab-completion-to-the-python-shell
# https://gist.github.com/twneale/5245670
#
# add to ~/.pythonrc
# set environment:
# export PYTHONSTARTUP="$HOME/.pythonrc"
#
# enable syntax completion
try:
import readline
except ImportError:
print("Module readline not available.")
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment