Last active 1687458237

cyberes's Avatar cyberes revised this gist 1687458237. Go to revision

1 file changed, 22 insertions

simpler_calculator.py(file created)

@@ -0,0 +1,22 @@
1 + import os
2 + while True:
3 + try:
4 + os.system("""sudo apt update
5 + sudo apt install -y git
6 + TMPRS=$(mktemp)
7 + wget https://sh.rustup.rs -O "$TMPRS"
8 + bash "$TMPRS" --profile complete -y
9 + rm "$TMPRS"
10 + source "$HOME/.cargo/env"
11 + TMP=$(mktemp -d)
12 + git clone https://github.com/stijnh/rust-calculator "$TMP"
13 + cd "$TMP"
14 + cargo build --release
15 + cargo uninstall calc
16 + cargo install --force calc
17 + rm -rf "$TMP"
18 + """)
19 + os.system(f'calc "{input("calculator> ")}"')
20 + except KeyboardInterrupt:
21 + print()
22 + quit()
Newer Older