title: Python Tkinter Button Action
body: <p>I have this code:</p>
  
  <pre><code>#!/usr/bin/python
  
  import Tkinter
  from tkFileDialog import askopenfilename
  import tkMessageBox
  
  root = Tkinter.Tk()
  
  def getFileName():
    # show an "Open" dialog box.
    filename = askopenfilename(filetypes = [('Text files', '*.txt'),('All files','*')])
  
  btnIco = Tkinter.Button(root, text="Icon", command=getFileName())
  btnIco.pack()
  
  root.mainloop()
  </code></pre>
  
  <p>What I intended to do was to run the function <code>getFileName</code> when the button is clicked. But instead the function runs when the code is run and the button does not do anything when clicked. Can you please point out what is wrong?</p>