Created
November 4, 2017 11:27
-
-
Save lmlsna/f1ad87e0af26ec099ff23946962a8c46 to your computer and use it in GitHub Desktop.
Enable tab completion in an interactive python2 shell
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
''' | |
This script enables tab competion for functions in the Python2 interactive shell. | |
It requires the readline and rlcompleter packages (install with pip) and set PYTHONSTARTUP | |
to this file's location as an enironmental variable in your .bashrc file. | |
''' | |
try: | |
import readline | |
except ImportError: | |
pass | |
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