From 09794886b24fdfb6e9aacde89543b2ba54da8027 Mon Sep 17 00:00:00 2001 From: Caleb Robinson Date: Tue, 5 Sep 2023 10:34:26 -0500 Subject: [PATCH] Add Leading 0 To Seconds --- tomato.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tomato.py b/tomato.py index ae62dc8..3bc44a0 100755 --- a/tomato.py +++ b/tomato.py @@ -59,7 +59,10 @@ def tomato(minutes, notify_msg): print('') break - countdown = '{}:{} ⏰'.format(int(left_seconds / 60), int(left_seconds % 60)) + seconds_slot = int(left_seconds % 60) + seconds_str = str(seconds_slot) if seconds_slot >= 10 else '0{}'.format(seconds_slot) + + countdown = '{}:{} ⏰'.format(int(left_seconds / 60), seconds_str) duration = min(minutes, 25) progressbar(diff_seconds, minutes * 60, duration, countdown) time.sleep(1)