In python,Tkinter is a Graphical user interface package.So,Tkinter tookit for GUI programming supports protocol handler mechanism. Protocol is taking care of how interaction takes place between application and windows manager. self.parent.protocol(\"WM_DELETE_WINDOW\",self.quit_handler) in the above line \"WM_DELETE_WINDOW\" is a protocol.What this protocl does is :it define what is going to happen when a user who uses the application and closes window explicitely using windows manager. Then this protocol \"WM_DELETE_WINDOE\" bypasses to quit_handler(). That quit_handler() asks user \"whether he or she wants to quit or not\" then simply quit the window. Solution In python,Tkinter is a Graphical user interface package.So,Tkinter tookit for GUI programming supports protocol handler mechanism. Protocol is taking care of how interaction takes place between application and windows manager. self.parent.protocol(\"WM_DELETE_WINDOW\",self.quit_handler) in the above line \"WM_DELETE_WINDOW\" is a protocol.What this protocl does is :it define what is going to happen when a user who uses the application and closes window explicitely using windows manager. Then this protocol \"WM_DELETE_WINDOE\" bypasses to quit_handler(). That quit_handler() asks user \"whether he or she wants to quit or not\" then simply quit the window..