title: Python: Tkinter: Why is it root.mainloop() and not app.mainloop()
body: <p>I'm a new member to Stack Overflow.
  I found this thread, but was not allowed to comment or ask questions on it, so I thought I'd just reference it here: <a href="https://stackoverflow.com/questions/18201195/how-can-i-make-a-in-interactive-list-in-pythons-tkinter-complete-with-buttons-t">How can I make a in interactive list in Python&#39;s Tkinter complete with buttons that can edit those listings?</a></p>
  
  <pre><code>from tkinter import *
  import os
  import easygui as eg
  
  class App:
  
      def __init__(self, master):
          frame = Frame(master)
          frame.pack()
  
          # character box
          Label(frame, text = "Characters Editor").grid(row = 0, column = 0, rowspan = 1, columnspan = 2)
          charbox = Listbox(frame)
          for chars in []:
              charbox.insert(END, chars)
          charbox.grid(row = 1, column = 0, rowspan = 5)
          charadd = Button(frame, text = "   Add   ", command = self.addchar).grid(row = 1, column = 1)
          charremove = Button(frame, text = "Remove", command = self.removechar).grid(row = 2, column = 1)
          charedit = Button(frame, text = "    Edit    ", command = self.editchar).grid(row = 3, column = 1)
  
      def addchar(self):
          print("not implemented yet")
      def removechar(self):
          print("not implemented yet")
      def editchar(self):
          print("not implemented yet")
  
  
  root = Tk()
  root.wm_title("IA Development Kit")
  app = App(root)
  root.mainloop()
  </code></pre>
  
  <p>Could somebody explain to me why the very last line is root.mainloop()?
  Being a novice with Python, and coming from a background that's procedural-oriented with no object-orient experience, I would have thought it would have been app.mainloop().</p>
  
  <p>In fact app = App(root) , app is never used again in the rest of the code! I'm having trouble understanding why root.mainloop() still works.</p>