notes/scripts/python/timer
2022-07-27 04:50:23 -07:00

17 lines
412 B
Python
Executable file

#!/bin/python
# https://realpython.com/python-subprocess/
import subprocess
from argparse import ArgumentParser
from time import sleep
parser = ArgumentParser()
parser.add_argument("time", type=int)
args = parser.parse_args()
print(f"Starting timer of {args.time} seconds")
for _ in range(args.time):
print(".", end="", flush=True)
sleep(1)
# print("Done!")
subprocess.call(["notify-send", "Done!"])