You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
317 B
20 lines
317 B
2 years ago
|
# -*- python -*-
|
||
|
|
||
|
import os
|
||
|
import atexit
|
||
|
import readline
|
||
|
|
||
|
history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history')
|
||
|
try:
|
||
|
readline.read_history_file(history)
|
||
|
except OSError:
|
||
|
pass
|
||
|
|
||
|
def write_history():
|
||
|
try:
|
||
|
readline.write_history_file(history)
|
||
|
except OSError:
|
||
|
pass
|
||
|
|
||
|
atexit.register(write_history)
|