This is a question of putting the Python tkinter button command.

Asked 2 years ago, Updated 2 years ago, 95 views

b1 = Button(window, text=" ", width=8, height=4, 
            command=lambda:markBoard(b1))

In the process of making a tiktakto game with tkinter, In this way, I'm putting a lambda command in button 1, so can you add more functions in addition to that lambda command in button 1? So you press the b1 button, and you can run two functions.

tkinter python

2022-09-22 17:55

1 Answers

Multiple functions can be called using parentheses, as shown below.

In [1]: a = lambda:(print('one'), print('two'))                               

In [2]: a()                                                                     
one
two
Out[2]: (None, None)


2022-09-22 17:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.