title: How to have parameters to a button command in tkinter python3
body: <p>I want to have UI where when I press a button, stuff pops up in the console. The issue is the stuff prints into the console before I press the button. After some testing, I have found that if I don't use parenthesis to call my function in the <code>command</code> argument, it works fine.</p>
  
  <p>ex: A function called <code>hello</code> prints hello world in the console, so I would call it like <code>button=Button(master, command=hello)</code> instead of <code>button=Button(master, command=hello())</code></p>
  
  <p>The issue with this way is I can't use parameters.</p>
  
  <p>here is an example of a code similar to mine:</p>
  
  <pre><code>index={'Food':['apple', 'orange'], 'Drink':['juice', 'water', 'soda']}
  Names=['Food', 'Drink']
  
  def display(list):
      for item in list:
          print(item)
  
  from tkinter import *
  mon=Tk()
  app=Frame(mon)
  app.grid()
  
  for item in Names:
      button=Button(mon, text=item, command=diplay(index[item]))
      button.grid()
  mon.mainloop()
  </code></pre>
  
  <p>Any ideas of how to be able to use parameters? I hope this all made sense, but if it didn't please leave a comment. Thank You.</p>