Created
August 14, 2015 13:24
-
-
Save davividal/350f820c16e0a0a5e228 to your computer and use it in GitHub Desktop.
This file contains 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
# Copied from http://jbisbee.blogspot.com.br/2013/07/add-history-and-tab-completion-to.html | |
try: | |
import readline | |
import rlcompleterimport atexit | |
import os | |
except ImportError: | |
print "Python shell enhancement modules not available." | |
else: | |
histfile = os.path.join(os.environ["HOME"], ".pythonhistory") | |
import rlcompleter | |
readline.parse_and_bind("tab: complete") | |
if os.path.isfile(histfile): | |
readline.read_history_file(histfile) | |
atexit.register(readline.write_history_file, histfile) | |
del os, histfile, readline, rlcompleter, atexit | |
print "Python shell history and tab completion are enabled." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment