From 81f1c6557ad28823b8008d6baa684f311066fe3f Mon Sep 17 00:00:00 2001 From: Stephen Mardson McQuay Date: Mon, 1 Nov 2010 15:51:16 -0600 Subject: [PATCH] added interactive prompt bootstraping code --- interp/bootstrap.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 interp/bootstrap.py diff --git a/interp/bootstrap.py b/interp/bootstrap.py new file mode 100644 index 0000000..7742642 --- /dev/null +++ b/interp/bootstrap.py @@ -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