From 8841a89281ee882856e1cd5ee6de5ae56b73033b Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Tue, 29 Oct 2019 17:23:23 +0200 Subject: [PATCH] [scripts] add Python calculator --- scripts/pycalc3 | 9 +++++++++ scripts/pycalc_startup.py | 3 +++ 2 files changed, 12 insertions(+) create mode 100755 scripts/pycalc3 create mode 100644 scripts/pycalc_startup.py diff --git a/scripts/pycalc3 b/scripts/pycalc3 new file mode 100755 index 0000000..e5154b7 --- /dev/null +++ b/scripts/pycalc3 @@ -0,0 +1,9 @@ +#!/bin/sh + +for python in bpython python3; do + if python="$(command -v "$python")"; then + break + fi +done +echo "using Python '$python'" +PYTHONSTARTUP="$(dirname "$0")/pycalc_startup.py" "$python" "$@" diff --git a/scripts/pycalc_startup.py b/scripts/pycalc_startup.py new file mode 100644 index 0000000..7cc169b --- /dev/null +++ b/scripts/pycalc_startup.py @@ -0,0 +1,3 @@ +from math import * + +print("loaded Python calculator")