added interactive prompt bootstraping code

This commit is contained in:
Stephen Mardson McQuay 2010-11-01 15:51:16 -06:00
parent 3aefd7b75c
commit 81f1c6557a

16
interp/bootstrap.py Normal file
View File

@ -0,0 +1,16 @@
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(historyPath=historyPath):
import readline
readline.write_history_file(historyPath)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath