run two commande in one tkinter button code example
Example 1: how to add multiple commands to tkinter button
all_commands = lamba: [func1(), func2()]
button = Button(window, text="This is a button", command=all_commands)
Example 2: python tkinter button multiple commands
pythonCopy def combineFunc(self, *funcs):
def combinedFunc(*args, **kwargs):
for f in funcs:
f(*args, **kwargs)
return combinedFunc