From 467dfe5e349f42952f89a776af184b4df930dc54 Mon Sep 17 00:00:00 2001 From: randomuser Date: Sat, 18 Jun 2022 15:41:52 -0500 Subject: [PATCH] python things --- Makefile | 4 +++- bash/profile | 3 +++ python/pythonrc.py | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 python/pythonrc.py diff --git a/Makefile b/Makefile index e306ca2..f0b6b1b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ LOCATION="$(HOME)/.config" DATA="$(HOME)/.local/share" -install_local: install_bspwm install_nvim install_sx install_sxhkd install_zathura install_simplestatus install_bash install_ssh install_git install_tridactyl install_htop +install_local: install_bspwm install_nvim install_sx install_sxhkd install_zathura install_simplestatus install_bash install_ssh install_git install_tridactyl install_htop install_python install: .environment install_bspwm: ln -sf $(CURDIR)/bspwm $(LOCATION)/bspwm @@ -24,5 +24,7 @@ install_tridactyl: ln -sf $(CURDIR)/tridactyl $(LOCATION)/tridactyl install_htop: ln -sf $(CURDIR)/htop $(LOCATION)/htop +install_python: + ln -sf $(CURDIR)/python $(LOCATION)/python .environment: sh environ diff --git a/bash/profile b/bash/profile index 44b946d..78775c7 100644 --- a/bash/profile +++ b/bash/profile @@ -5,6 +5,9 @@ export HISTFILE="$HOME/.config/bash/hist" export HISTFILESIZE=3000 +# python +export PYTHONSTARTUP="$HOME/.config/python/pythonrc.py" + # less export LESSHISTFILE="-" diff --git a/python/pythonrc.py b/python/pythonrc.py new file mode 100644 index 0000000..dd41f36 --- /dev/null +++ b/python/pythonrc.py @@ -0,0 +1,19 @@ +import os +import atexit +import readline + +history = os.path.join(os.path.expanduser('~'), '.cache/python_history') +try: + readline.read_history_file(history) +except OSError: + pass + +def write_history(): + try: + readline.write_history_file(history) + except OSError: + pass + +print("laskdjflaskfjd") + +atexit.register(write_history)