simpler_calculator.py
Raw
import os
while True:
try:
os.system("""sudo apt update
sudo apt install -y git
TMPRS=$(mktemp)
wget https://sh.rustup.rs -O "$TMPRS"
bash "$TMPRS" --profile complete -y
rm "$TMPRS"
source "$HOME/.cargo/env"
TMP=$(mktemp -d)
git clone https://github.com/stijnh/rust-calculator "$TMP"
cd "$TMP"
cargo build --release
cargo uninstall calc
cargo install --force calc
rm -rf "$TMP"
""")
os.system(f'calc "{input("calculator> ")}"')
except KeyboardInterrupt:
print()
quit()
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() |