mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts] add Python calculator
This commit is contained in:
parent
0f082b90a1
commit
8841a89281
2 changed files with 12 additions and 0 deletions
9
scripts/pycalc3
Executable file
9
scripts/pycalc3
Executable file
|
@ -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" "$@"
|
3
scripts/pycalc_startup.py
Normal file
3
scripts/pycalc_startup.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from math import *
|
||||||
|
|
||||||
|
print("loaded Python calculator")
|
Loading…
Reference in a new issue