V0ight
0
Q:

tkinter button command with arguments

from functools import partial
#
#
def function_name(arg1):
    print(arg1)
#
#tkinter codes for GUI
#
buttonExample = tk.Button(main, text="Button", command=partial(function_name, argument1))
4
# One way is to use lambda
button = tk.Button(root, text="Button", command=lambda: func(args))
2

New to Communities?

Join the community