# pythonrc. HISTORYFILE="/home/yusuke/.pythonhistory" try: import rlcompleter, readline # readline and rlcompleter available. readline.parse_and_bind("tab: complete") readline.parse_and_bind("set input-meta on") readline.parse_and_bind("set convert-meta off") readline.parse_and_bind("set output-meta on") try: # check if the history file is available. f = open(HISTORYFILE, "a") f.close() readline.read_history_file(HISTORYFILE) except IOError: # for some reason... pass try: import atexit # atexit is available. atexit.register(lambda: readline.write_history_file(HISTORYFILE)) except: # atexit is not available in Python1.5. pass except: # neither readline nor rlcompleter is available. pass