Created
September 22, 2013 23:31
-
-
Save gcmurphy/6664880 to your computer and use it in GitHub Desktop.
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
| # save as ~/.pythonstartup.py | |
| # export PYTHONSTARTUP=$HOME/.pythonstartup.py | |
| # (gives you tab completion / history) | |
| import readline | |
| import rlcompleter | |
| import atexit | |
| import os | |
| readline.parse_and_bind('tab: complete') | |
| history = os.path.join(os.environ['HOME'], '.pythonhistory') | |
| try: | |
| readline.read_history_file(history) | |
| except IOError as e: | |
| pass | |
| atexit.register(readline.write_history_file, history) | |
| del os, history, readline, rlcompleter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment