user_startup.py
# python startup fileimport sysimport readlineimport rlcompleterimport atexitimport os # tab completionreadline.parse_and_bind('tab: complete')# history filehistfile = os.path.join(os.environ['HOME'], '.pythonhistory')try:readline.read_history_file(histfile)except IOError:passatexit.register(readline.write_history_file, histfile)del os, histfile, readline, rlcompleter
引入方式:import user_startup