# Point 'PYTHONSTARTUP' environment variable to this file. import atexit # Commonly used modules handily imported. from itertools import * from os import * from os.path import * from pprint import * from sys import * try: import readline import rlcompleter except ImportError: pass # Vim mode with a few more bindings. readline_init = """set editing-mode vi tab: complete C-L: clear-screen C-P: previous-history C-N: next-history """ map(readline.parse_and_bind, readline_init.splitlines()) # Save and reload history. histFile = join(environ['HOME'], '.pyhistory') try: readline.read_history_file(histFile) except IOError: pass readline.set_history_length(500) atexit.register(readline.write_history_file, histFile) del histFile, readline_init