0
user_info = {
 'city',
 'citya',
 'citys',
 'cityd',
 'cityf',

}
counter=0

def submit(x):
    print(x)
for i in user_info:

    cur_entrybox = ttk.Button(win, width=16,text=i,command=submit(i))
    cur_entrybox.grid(column=1, row=counter)
    counter += 1 

I want when I click the button to pass argument as the button name for EX: When I click a button with name "City" I want to make like this command=submit("city") Can any help me! Thanks

  • Presumably you want to use `lambda` here, and you will run up against [this issue](https://stackoverflow.com/q/2295290/12299000). – kaya3 Mar 04 '22 at 14:00
  • What is `ttk`? Seems you're using special package that you didn't mention it. Please make everything explicit in your question and add the name of special package in question's tag. – Shayan Mar 04 '22 at 14:00

0 Answers0