Add a countdown timer that updates on a single line in the terminal.
Why
Tiny script, two new ideas: time.sleep for pacing, and \r + flush=True to overwrite a line instead of spamming 300 lines of output. Everyone's first timer prints a new line every second — this one shouldn't.
Suggested file
scripts/countdown_timer.py
What it should do
- Usage:
python scripts/countdown_timer.py 90 or python scripts/countdown_timer.py 1:30
- Display
MM:SS counting down in place, then print a finish message and beep (print("\a")).
Acceptance criteria
Inspiration
Countdown from Awesome-Python-Scripts.
Good first issue — comment below to get assigned.
Add a countdown timer that updates on a single line in the terminal.
Why
Tiny script, two new ideas:
time.sleepfor pacing, and\r+flush=Trueto overwrite a line instead of spamming 300 lines of output. Everyone's first timer prints a new line every second — this one shouldn't.Suggested file
scripts/countdown_timer.pyWhat it should do
python scripts/countdown_timer.py 90orpython scripts/countdown_timer.py 1:30MM:SScounting down in place, then print a finish message and beep (print("\a")).Acceptance criteria
\randend="",flush=True— not one line per tick.MM:SSformat.Ctrl+Cprints the remaining time and exits cleanly, no traceback.time,argparse).Inspiration
Countdown from Awesome-Python-Scripts.
Good first issue — comment below to get assigned.