code: def key_press(self, key, x, y):
          "Close the application when the player presses ESCAPE"
          if ord(key) == 27:
              # print "Escape!"
              if bool(glutLeaveMainLoop):
                  glutLeaveMainLoop()
              else:
                  raise Exception("Application quit"f key_press(self, key, x, y):
          "Close the application when the player presses ESCAPE"
          if ord(key) == 27:
              # print "Escape!"
              if bool(glutLeaveMainLoop):
                  glutLeaveMainLoop()
              else:
                  raise Exception("Application quit")
docs: Close the application when the player presses ESCAPE