<filename>WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/sched/sched_priority.py
#!/usr/bin/env python3
"""Basic sched example
"""

# end_pymotw_header
import sched
import time

scheduler = sched.scheduler(time.time, time.sleep)


def print_event(name):
    print("EVENT:", time.ctime(time.time()), name)


now = time.time()
print("START:", time.ctime(now))
scheduler.enterabs(now + 2, 2, print_event, ("first",))
scheduler.enterabs(now + 2, 1, print_event, ("second",))

scheduler.run()

<filename>WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/sched/sched_priority.py
#!/usr/bin/env python3
"""Basic sched example
"""

# end_pymotw_header
import sched
import time

scheduler = sched.scheduler(time.time, time.sleep)


def print_event(name):
    print("EVENT:", time.ctime(time.time()), name)


now = time.time()
print("START:", time.ctime(now))
scheduler.enterabs(now + 2, 2, print_event, ("first",))
scheduler.enterabs(now + 2, 1, print_event, ("second",))

scheduler.run()

#!/usr/bin/env python3 Basic sched example # end_pymotw_header