summaryrefslogtreecommitdiffstats
path: root/.pythonrc
blob: 9f7cd95720ee8b5fc2b4620845d621df87132c55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import atexit
import os
import readline
import rlcompleter

history_path = os.path.expanduser("~/.pyhistory")

def save_history(history_path=history_path):
    import readline
    readline.write_history_file(history_path)

if os.path.exists(history_path):
    readline.read_history_file(history_path)

atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, history_path