import readline, rlcompleter; readline.parse_and_bind('tab: complete') import os readline.write_history_file(os.path.expanduser("~/.python_history")) readline.read_history_file(os.path.expanduser("~/.python_history"))