From 8674b4b49597d808d65a55a7e14fb410497c5017 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Mon, 4 Nov 2024 11:13:19 -0500 Subject: [PATCH] python: interactive console imports sympy by default --- src/dot_config/pythonstartup.py | 7 +++++++ src/dot_config/vars.tmpl | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 src/dot_config/pythonstartup.py diff --git a/src/dot_config/pythonstartup.py b/src/dot_config/pythonstartup.py new file mode 100644 index 0000000..a253afb --- /dev/null +++ b/src/dot_config/pythonstartup.py @@ -0,0 +1,7 @@ +try: + from sympy import init_session, Rational + init_session() + + R = Rational +except ImportError: + pass diff --git a/src/dot_config/vars.tmpl b/src/dot_config/vars.tmpl index 7621d0c..4fa546d 100644 --- a/src/dot_config/vars.tmpl +++ b/src/dot_config/vars.tmpl @@ -8,6 +8,9 @@ export VARS_SET=1 # by default chmod o-rwx umask 007 +# python rc/startup file +export PYTHONSTARTUP="$HOME/.config/pythonstartup.py" + # Set XDG directories export XDG_CONFIG_HOME="$HOME"/.config export XDG_CACHE_HOME="$HOME"/.cache