title: How do I store an integer input from the user into a variable in Tkinter?
body: <p>For my Python class were using <code>turtle</code> graphics. </p>
  
  <p>We have too draw a target that appears at a random location on the screen. Got that. </p>
  
  <p>Then a pop up window appears asking for what you think the coordinates of the target are. First the pop up box asks you to enter the <code>x</code> coordinate then it asks you to enter the <code>y</code> coordinate. </p>
  
  <p>I'm having trouble saving the users inputed integers from my Tkinter window into variables I can use later in the program.</p>
  
  <pre><code>from Tkinter import *
  
  
  window = Tk()                
  window.title("Player Input") 
  window.geometry('+350+130') 
  
  thexinput = IntVar()  
  
  L1 = Label(window, text="Enter the x coordinate for Mike")
  L1.pack( side = LEFT)
  E1= Entry(window, textvariable= thexinput, bd =5)
  E1.pack(side = RIGHT)
  
  def userinput():
      global inp
      a = raw_input(thexinput.get())
      inp = a
  
  b = Button(window, text = 'Submit', command = userinput)
  b.pack(side = BOTTOM)
  
  window.mainloop()
  </code></pre>