From b59192baf1ed227af0f3d2b834504c2af155d4e6 Mon Sep 17 00:00:00 2001 From: Marc Mance Date: Wed, 31 Jul 2024 18:10:35 -0400 Subject: [PATCH] changed to minutes to wait --- collect.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/collect.py b/collect.py index 11e822c..364a394 100644 --- a/collect.py +++ b/collect.py @@ -377,23 +377,16 @@ def main(): welcome() minutes = int(input("Enter the duration in minutes: ")) - startHour = 0 + minutesToWait = int(input("Enter the delay before capture in minutes: ")) - while not is_two_digit_number(startHour): - startHour = int( - input("Enter start time on 24hr format, 2-digit (ie 2pm = 14): ") - ) - if not is_two_digit_number(startHour): - print("please enter only 2 digits.") + if not minutesToWait: + minutesToWait = 0 - currentTime = datetime.datetime.now() - currentHour = currentTime.hour - - while not currentHour == startHour: - print(f"Current Time: {currentTime}, script will start at: {startHour}:00") - datetime.datetime.sleep(5) - currentTime = datetime.datetime.now() - currentHour = currentTime.hour + if minutesToWait: + print("Delaying capture by {minutesToWait} minutes...") + for i in range(minutesToWait): + print(f"{i} ", end="", flush=True) + datetime.datetime.sleep(minutesToWait * 60) print("Starting Collection")