Created
April 6, 2012 14:58
-
-
Save BlueSkyDetector/2320582 to your computer and use it in GitHub Desktop.
completer setting for python interactive shell
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
# add following line to .bashrc | |
#PYTHONSTARTUP=$HOME/.pythonrc.py | |
#export PYTHONSTARTUP | |
try: | |
import readline | |
import rlcompleter | |
pass | |
except ImportError, error_string: | |
print 'ImportError: %s' % error_string | |
pass | |
else: | |
readline.parse_and_bind('tab: complete') | |
try: | |
import os | |
hist = os.path.join(os.environ['HOME'], '.pyhist') | |
if os.access(hist, os.F_OK) : | |
readline.read_history_file(hist) | |
pass | |
import atexit | |
atexit.register(readline.write_history_file, hist) | |
del os, atexit | |
pass | |
except ImportError, errro_string: | |
print 'ImportError: %s' % error_string | |
pass | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment