code: def interpret(self):
          
          self.print_menu()
          while True:
              try:
                  event = input()
                  if event == 'q':
                      return
                  event = int(event)
                  event = self.model.events[event-1]
              except Exception:
                  print('Invalid input')
  
              self.event(event)
              self.print_menu()
docs: Main interpreter loop.