I want to run a file I have once every hour but need to avoid patterns. Example of what I need if I ran it at 1 PM:
1:12 PM
2:26 PM
3:24 PM
4:59 PM
5:02 PM
Currently, I have this:
import schedule
import time
import random
def randomS():
min_wait = random.randint(0,59)
time.sleep(min_wait*60)
run()
def run():
# exec(open('Mudae.py').read())
seconds = time.time()
local_time = time.ctime(seconds)
print(local_time)
schedule.every(1).hours.do(randomS)
randomS()
while True:
schedule.run_pending()
The problem with this code is that this code will occasionally skip an entire hour.