复制代码def load_history(): readline.set_history_length(10000) try: if os.path.exists(history_file_path): readline.read_history_file(history_file_path) except IOError: pass