title: Python, Tkinter,How to change GUI based on buttonclick
body: <p>I am using Tkinter in a programming assignment and have the following problem.
  I want the user to enter the value in a textbox, and I want to add additional fields on the GUI based on the number entered in the textbox when he/she clicks the submit-button.</p>
  
  <p>I tried to place code inside of the function 'displayText()', which is called when the submit-button is pressed; however, the GUI-related code that I placed inside of it was loaded when the window was loaded.</p>
  
  <pre><code>import tkinter
  
  #When user clicks on button
  def displayText():
      #DO CHANGE IN GUI
  
  root = tkinter.Tk()
  button = tkinter.Button(root, text="Submit", command=displayText())
  button.pack()
  
  root.mainloop()
  </code></pre>