sched.scheduler.run()

scheduler.run(blocking=True) Run all scheduled events. This method will wait (using the delayfunc() function passed to the constructor) for the next event, then execute it and so on until there are no more scheduled events. If blocking is false executes the scheduled events due to expire soonest (if any) and then return the deadline of the next scheduled call in the scheduler (if any). Either action or delayfunc can raise an exception. In either case, the scheduler will maintain a consistent

sched.scheduler.queue

scheduler.queue Read-only attribute returning a list of upcoming events in the order they will be run. Each event is shown as a named tuple with the following fields: time, priority, action, argument, kwargs.

sched.scheduler.enterabs()

scheduler.enterabs(time, priority, action, argument=(), kwargs={}) Schedule a new event. The time argument should be a numeric type compatible with the return value of the timefunc function passed to the constructor. Events scheduled for the same time will be executed in the order of their priority. Executing the event means executing action(*argument, **kwargs). argument is a sequence holding the positional arguments for action. kwargs is a dictionary holding the keyword arguments for actio

sched.scheduler.enter()

scheduler.enter(delay, priority, action, argument=(), kwargs={}) Schedule an event for delay more time units. Other than the relative time, the other arguments, the effect and the return value are the same as those for enterabs(). Changed in version 3.3: argument parameter is optional. New in version 3.3: kwargs parameter was added.

sched.scheduler.empty()

scheduler.empty() Return true if the event queue is empty.

sched.scheduler.cancel()

scheduler.cancel(event) Remove the event from the queue. If event is not an event currently in the queue, this method will raise a ValueError.

sched.scheduler

class sched.scheduler(timefunc=time.monotonic, delayfunc=time.sleep) The scheduler class defines a generic interface to scheduling events. It needs two functions to actually deal with the “outside world” — timefunc should be callable without arguments, and return a number (the “time”, in any units whatsoever). If time.monotonic is not available, the timefunc default is time.time instead. The delayfunc function should be callable with one argument, compatible with the output of timefunc, and

RuntimeWarning

exception RuntimeWarning Base class for warnings about dubious runtime behavior.

RuntimeError

exception RuntimeError Raised when an error is detected that doesn’t fall in any of the other categories. The associated value is a string indicating what precisely went wrong.

runpy.run_path()

runpy.run_path(file_path, init_globals=None, run_name=None) Execute the code at the named filesystem location and return the resulting module globals dictionary. As with a script name supplied to the CPython command line, the supplied path may refer to a Python source file, a compiled bytecode file or a valid sys.path entry containing a __main__ module (e.g. a zipfile containing a top-level __main__.py file). For a simple script, the specified code is simply executed in a fresh module namesp