bgneal@14: # python startup file bgneal@14: try: bgneal@14: import readline bgneal@14: except ImportError: bgneal@14: pass bgneal@14: else: bgneal@14: import atexit bgneal@14: import os bgneal@14: import rlcompleter bgneal@14: bgneal@14: # tab completion bgneal@14: readline.parse_and_bind('tab: complete') bgneal@14: bgneal@14: # history file bgneal@14: histfile = os.path.join(os.environ['HOME'], '.pythonhistory') bgneal@14: try: bgneal@14: readline.read_history_file(histfile) bgneal@14: except IOError: bgneal@14: pass bgneal@14: readline.set_history_length(1024) bgneal@14: bgneal@14: atexit.register(readline.write_history_file, histfile) bgneal@14: del os, histfile, readline, rlcompleter