r/code • u/Select-Complaint-762 • Aug 08 '24
Help Please why doesnt this code work
target_hour = 18
target_minute = 9
target_hour2 = 18
target_minute2 = 6
while True:
current_time = datetime.now()
print(current_time.hour, current_time.minute)
if current_time.hour == target_hour and current_time.minute == target_minute:
print('match')
3
Upvotes
View all comments
Show parent comment
2
u/still_using_ifs Aug 08 '24
Yeah that was what I was thinking. Are you getting any error messages when running it?