I created a button "button" and I want to call a function "function" when I press on this button. When I run the program, the function is called and then the button appears. If I press it once again, the function is not called. So how to disable calling the function without pressing the button and how to enable calling the function at each press on the butotn?
from tkinter import *
def function():
what this function does
root = Tk()
button = Button(root,text="Call function", command=function())
button.pack()
root.mainloop()