def SetSchedules():
while True:
current_time = datetime.datetime.now().strftime("%H:%M")
for i in range(len(Dates)):
if Dates[i] == str(datetime.date.today()):
if Train1[i] == current_time:
print(f"Train 1 has arrived at {current_time}!")
if Train2[i] == current_time:
print(f"Train 2 has arrived at {current_time}!")
if Train3[i] == current_time:
print(f"Train 3 has arrived at {current_time}!")
if Train4[i] == current_time:
print(f"Train 4 has arrived at {current_time}!")
if Train5[i] == current_time:
print(f"Train 5 has arrived at {current_time}!")
time.sleep(60 - int(datetime.datetime.now().strftime("%S")))
tried to fix it with various methods, but wont fix. can someone help with this please.
2