title: How to get a different output in textbox then what the user enters
body: <p>I just recently started using <code>tkinter</code>, and my question is how do i get a different output in the widget then what the user enters. Currently my GUI prints whatever the user types in the entry box and prints what the user types into a textbox. </p>
  
  <p>How would I go about making if a certain word is entered in the entry box a sentence would be printed instead of the actual word. Example: user types in <code>"cat"</code>, so it prints <code>"Hello I heard you like cats"</code> in the textbox</p>
  
  <p>This is my current code:</p>
  
  <pre><code>from tkinter import *
  import sys
  
  class Display(Frame):
  
      mGui = Tk()
      mGui.geometry("500x500-500-300")
      mGui.title("GUI")
      mlabel = Label(mGui, text="Welcome").pack()
  
      def __init__(self):
          Frame.__init__(self)
          self.entry = Entry(self)
          self.entry.pack()
          self.entry.bind("&lt;Return&gt;", self.onEnter)
          self.clearButton = Button(self, text="Clear text", command=self.clear_text)
          self.clearButton.pack()
          self.output = Text(self)
          self.output.pack()
          sys.stdout = self
          self.pack()
  
      def onEnter(self, Frame):
          print(self.entry.get())
  
      def write(self, txt):
          self.output.insert(END, str(txt))
  
      def clear_text(self):
          self.entry.delete(0, "end")
  
  if __name__ == '__main__':
      Display().mainloop()
  </code></pre>