title: Python3: GUI later cannot display output properly?
body: <p>I'm designing a GUI application that converts between celsius and fahrenheit. For now, there're primarily two problems that I'm not able to tackle:</p>
  
  <p><strong>1)</strong> When I enter an integer that needs to be converted based on the given conversion formula, the Label from <code>tkinter</code> cannot display the output properly. In fact, it shows something like this: </p>
  
  <pre><code>&lt;conversionModel.Conversion object at 0x1057b11d0&gt;
  </code></pre>
  
  <p>which made it really difficult for debug to a beginner like me.</p>
  
  <p><strong>2)</strong> There's a <code>quitButton</code>, thought which we can <code>destroy()</code> the GUI application. The problem is that when I close the GUI by clicking the red cross of the window, the Shell says: </p>
  
  <p><code>_tkinter.TclError: can't invoke "destroy" command:  application has been destroyed</code></p>
  
  <p>I checked answers to other questions regarding the same problem, it turned out that it was because this GUI application was destroyed before closing. I had no idea how to address this particular problem.</p>
  
  <p>Below are three pieces of code written in Model/View/Controller form:</p>
  
  <p><strong>The Model in conversionModel.py:</strong></p>
  
  <pre><code>class Conversion:
  
          """
          class Conversion is the Model for a celsius-fahrenheit conversion
          application. It converts celsius into fahrenheit and fahrenheit into
          celsius.
          """
  
          def toCelsius(self, temp):
              return (5 / 9) * (temp - 32)
  
          def toFahrenheit(self, temp):
              return ((9 / 5) * temp) + 32
  </code></pre>
  
  <p><strong>The View in conversionView.py:</strong></p>
  
  <pre><code>import tkinter
  
  class MyFrame(tkinter.Frame):
  
  def __init__(self, controller):
      tkinter.Frame.__init__(self)
      self.pack()
      self.controller = controller
  
      self.tempEntry = tkinter.Entry()
      self.tempEntry.insert(0, "0")
      self.tempEntry.pack({"side": "left"})        
  
      self.celsiusButton = tkinter.Button(self)
      self.celsiusButton["text"] = "Celsius"
      self.celsiusButton["command"] = self.controller.buttonToC
      self.celsiusButton.pack({"side": "left"})
  
      self.fahrenheitButton = tkinter.Button(self)
      self.fahrenheitButton["text"] = "Fahrenheit"
      self.fahrenheitButton["command"] = self.controller.buttonToF
      self.fahrenheitButton.pack({"side": "left"})
  
      self.labelForOutput = tkinter.Label(self)
      self.labelForOutput["text"] = 0
      self.labelForOutput.pack ({"side": "left"})
  
      self.quitButton = tkinter.Button(self)
      self.quitButton["text"] = "Quit"
      self.quitButton["command"] =  self.quit
      self.quitButton.pack({"side": "left"})
  </code></pre>
  
  <p><strong>The Controller in controller.py:</strong></p>
  
  <pre><code>import tkinter
  import conversionView
  import conversionModel
  
  class Controller:
  
      def __init__(self):
          root = tkinter.Tk()
          self.model = conversionModel.Conversion()
          self.view = conversionView.MyFrame(self)
          self.value = float(self.view.tempEntry.get())
          self.view.mainloop()
          root.destroy()
  
      def buttonToC(self):
          self.model.toCelsius(self.value)
          self.view.labelForOutput["text"] = str(self.model) + " °C"
  
      def buttonToF(self):
          self.model.toFahrenheit(self.value)
          self.view.labelForOutput["text"] = str(self.model) + " °F"
  
  if __name__ == "__main__":
      c = Controller()
  </code></pre>