title: Entry Widget: Storing It In Variable
body: <p>I wanted to store data from Entry to an variable.
  So I did this:</p>
  
  <pre><code>main = Tk()
  
  main.title("Players Names")
  
  var1 = StringVar()
  var2 = StringVar()
  
  Label(main, text="Player One: ").pack(side=LEFT)
  e1 = Entry(main, textvariable=var1).pack(side=LEFT)
  Label(main, text="Player Two: ").pack(side=LEFT)
  e2 = Entry(main, textvariable=var2).pack(side=LEFT)
  
  def enter():
      player1 = var1.get()
      player2 = var2.get()
  
  
  def printIt():
      print player1
      print player2
  
  Button(main, width=15, text="ENTER", command=enter).pack(side=LEFT)
  Button(main, width=15, text="PRINT", command=printIt).pack(side=LEFT)
  
  main.mainloop()
  </code></pre>
  
  <p>When I tried it...</p>
  
  <p>...it printed nothing. What shall I do (except by putting the printIt function in enter function. I know this; i just want to store the data)?</p>