I’m looking for an alternative to the sched module which would allow me to cancel all events at any time. sched only allows to cancel single events by id (which is returned from the scheduler when an event is scheduled).
Any pointers to Python alternatives to sched would be appreciated.
Thanks
Toni p
I’m looking for an alternative to the sched module which would allow me to
Share
In python 2.6, there is a read-only attribute called
queuereturning a list of upcoming events. So this will cancel all events:Update for Python 3:
Python 3 map() returns the iterator. Therefore, the object must be converted to the list.
Check out https://stackoverflow.com/a/1303354/6523409 and https://stackoverflow.com/a/13623676/6523409