pythonrc and other dotfiles

This commit is contained in:
2023-11-28 21:04:15 -06:00
parent b30073b7b8
commit 66b4ce43d2
2 changed files with 20 additions and 0 deletions

17
dotfiles/pythonrc Normal file
View File

@@ -0,0 +1,17 @@
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)