title: Getting tkinter to display output in a textbox
body: <p>I'm trying to create a small GUI that when the user enters a number into a text box, and it displays (as a label) whether it is a prime number or not. </p>
  
  <p>The code I have currently "works" (as in no errors are displayed) but the label doesn't change. </p>
  
  <p>The prime number code works in the python shell. </p>
  
  <p>My code is as follows:</p>
  
  <pre><code>from tkinter import *
  
  root = Tk()
  
  label1 = Label( root, text="Enter Number")
  E1 = Entry(root, bd =5)
  
  def isPrime():
      entry1 = E1.get()
      entry1 = int(entry1)
      for d in range(2,entry1):
          if entry1 % d == 0:
              label1 = Label(root, text="Not prime")
              root.update_idletasks()
              break
      else:
          label1 = Label(root, text="Is prime")
  
  
  submit = Button(root, text ="Submit", command = isPrime)
  root.update_idletasks()
  
  label1.pack()
  E1.pack()
  submit.pack(side =BOTTOM) 
  root.mainloop()
  </code></pre>
  
  <p>Thanks for any help in advance, and please let me know if you'd like any more clarification about any issues. Thanks. </p>