import time import datetime def loop(): current_day = 0 while True: if check_new_day(current_day): pass print(current_day) current_day = update_day() time.sleep(1) def check_new_day(current_day): if current_day == datetime.datetime.now().day: return True def update_day(): return datetime.datetime.now().day