2019-11-24 15:50:07 +01:00
|
|
|
import atexit
|
|
|
|
import os
|
|
|
|
import readline
|
|
|
|
|
|
|
|
histfile = os.path.join(os.getenv(
|
2022-09-05 09:53:48 +02:00
|
|
|
'XDG_STATE_HOME', os.path.expanduser('~/.cache')
|
|
|
|
), 'python', 'history')
|
2019-11-24 15:50:07 +01:00
|
|
|
|
|
|
|
try:
|
|
|
|
readline.read_history_file(histfile)
|
|
|
|
readline.set_history_length(1000)
|
|
|
|
except FileNotFoundError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
atexit.register(readline.write_history_file, histfile)
|