aboutsummaryrefslogtreecommitdiff
path: root/.config/python/pythonrc.py
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-04-22 12:10:42 -0300
committerEuAndreh <eu@euandre.org>2022-04-22 12:29:22 -0300
commiteb847a024b813eafe34835974f2e896a21fca04b (patch)
tree79bc48f1adee0ad9d1736305c0a10caaba287732 /.config/python/pythonrc.py
parent.config/guix/home.scm: Add working home declaration (diff)
downloaddotfiles-eb847a024b813eafe34835974f2e896a21fca04b.tar.gz
dotfiles-eb847a024b813eafe34835974f2e896a21fca04b.tar.xz
.config/: Add configuration files, migrated from "dotfiles" repository
Diffstat (limited to '.config/python/pythonrc.py')
-rw-r--r--.config/python/pythonrc.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/.config/python/pythonrc.py b/.config/python/pythonrc.py
new file mode 100644
index 00000000..1fc3bfe5
--- /dev/null
+++ b/.config/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)