title: Python Tkinter - Passing values with a button
body: <p>How do I pass parameters to a function through a button? </p>
  
  <pre><code>variable = str()
  
  def RandomFunction(variable): 
      print (variable) 
  
  EntryBox = Entry(MainWindow, textvariable = variable).pack() 
  FunctionCall = Button(MainWindow, text="Enter", command=RandomFunction(variable)) 
  </code></pre>
  
  <p>It seems like it just doesnt print anything when the button is pressed. I've searched around and it seems that using <code>lambda</code> can fix it and allow (variable) to be passed to the function but after experimenting with <code>lambda variable:variable</code> I still can't get it to work.</p>