Button Command in tkinter PYTHON
I successed to make tic-tac-toe in python so I tried making tic-tac-toe in tkinter. Then I made nine buttons and tried using command to them. But there were some errors. So I started to test parameter, ‘command’. The codes were like this(test): —————————————————————— from tkinter import * def click(): btn.configure(text = ‘O’) window = Tk() btn = Button(window, command = click) window.mainloop() —————————————————————— It worked well;; But this codes got errors: —————————————————————— from tkinter import * def click(a): if a == 1: btn.configure(text = ‘O’) elif a == 2: btn.configure(text = ‘X’) window = Tk() btn = Button(window, command = click(1)) window.mainloop() —————————————————————— So, why are there some errors? Please let me know the reason.