Last active 1687458237

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