3 ms·
I haven't looked a Jupyter at all; in plain Python, I'd start with something like this[1]: schedule = set() # (time, function) pairs while True: next=m
by kd5bjo 9y ago
I haven't looked a Jupyter at all; in plain Python, I'd start with something like this[1]:
schedule = set() # (time, function) pairs
while True:
next=min(schedule)
schedule.remove(next)
sleep(next[0] - now())
next[1]()
schedule.add((now() + interval, next[1]))
[1] Pseudocode only; I don't have the API reference in front of me to verify method names and such. Several edge cases are unhandled.