Files

20 lines
401 B
Python
Raw Permalink Normal View History

2010-11-01 15:51:16 -06:00
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
2011-09-17 15:38:49 -06:00
2010-11-01 15:51:16 -06:00
def save_history(historyPath=historyPath):
2011-09-17 15:38:49 -06:00
import readline
readline.write_history_file(historyPath)
2010-11-01 15:51:16 -06:00
if os.path.exists(historyPath):
2011-09-17 15:38:49 -06:00
readline.read_history_file(historyPath)
2010-11-01 15:51:16 -06:00
rl = rlcompleter
2010-11-01 15:51:16 -06:00
atexit.register(save_history)
del os, atexit, readline, rl, save_history, historyPath