python - How to pass arguments to a Button command in Tkinter? - Stack Overflow

PHOTO EMBED

Wed Dec 29 2021 08:13:40 GMT+0000 (Coordinated Universal Time)

Saved by @kartick_sriram #python

from functools import partial
#(...)
action_with_arg = partial(action, arg)
button = Tk.Button(master=frame, text='press', command=action_with_arg)
content_copyCOPY

another method to pass args in function without invoking fucntion

https://stackoverflow.com/questions/6920302/how-to-pass-arguments-to-a-button-command-in-tkinter