October 2018
Beginner to intermediate
676 pages
18h 30m
English
We will write a class with the appropriate methods to simulate the loop, and capture the exceptions and callback functions. For explanation purposes, we provide a step by step description of various methods in the class; for execution, you will have to take the entire class at once to run the code. Please refer to the code file provided for this chapter:
class EventLoop:
def __init__(self): self.status = None self.event_handlers = {"interrupt": self.handle_interrupt, "DivideByZero": self.handle_DivideByZero}
Read now
Unlock full access