mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-11-09 22:10:48 -05:00
18 lines
323 B
Text
18 lines
323 B
Text
|
import os
|
||
|
import atexit
|
||
|
import readline
|
||
|
|
||
|
history = os.path.join(os.environ['XDG_STATE_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)
|