dotfiles

My dotfiles for Arch Linux
git clone git://git.janispagel.de/dotfiles.git
Log | Files | Refs | README

commit 08da32eedcf76f74a4a59b51ec9a37b92c46053b
parent 3ff2e6a28194887b513ed91d5e4ee8a4352ae0fc
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Tue, 10 Nov 2020 16:10:48 +0100

Add python config

This enables to specify where python stores its hist file

Diffstat:
Apython/.config/python/pythonstartup.py | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/python/.config/python/pythonstartup.py b/python/.config/python/pythonstartup.py @@ -0,0 +1,14 @@ +import atexit +import os +import readline + +histfile = os.path.join(os.path.expanduser("~"), ".cache", "python", + "python_history") +try: + readline.read_history_file(histfile) + # default history len is -1 (infinite), which may grow unruly + readline.set_history_length(1000) +except FileNotFoundError: + pass + +atexit.register(readline.write_history_file, histfile)