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.