aboutsummaryrefslogtreecommitdiff
path: root/etc/python/pythonrc.py
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-11-17 17:58:41 -0300
committerEuAndreh <eu@euandre.org>2022-11-17 17:58:41 -0300
commit62ca1a97e0848ef5f9043da69c6af8a9b0bb9808 (patch)
tree9fa23a49cf205c7162a3604418775cbc798ee3c7 /etc/python/pythonrc.py
parentInitial empty commit (diff)
parentopt/bin-dirs/clisp: Include custom build of CLISP (diff)
downloaddotfiles-62ca1a97e0848ef5f9043da69c6af8a9b0bb9808.tar.gz
dotfiles-62ca1a97e0848ef5f9043da69c6af8a9b0bb9808.tar.xz
Merge remote-tracking branch 'tilde/main'
Diffstat (limited to 'etc/python/pythonrc.py')
-rw-r--r--etc/python/pythonrc.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/python/pythonrc.py b/etc/python/pythonrc.py
new file mode 100644
index 0000000..1fc3bfe
--- /dev/null
+++ b/etc/python/pythonrc.py
@@ -0,0 +1,15 @@
+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():
+ readline.write_history_file(history)
+
+atexit.register(write_history)