I have a Python function that takes no parameters. In my code, I call this function twice. Once as a command behind a Tkinter Button and once as a function to an event that I bind to a window. For the command, I call the function as func and that works fine. For the event, it will only work if I call it as func() and change the definition of the function to be: func(self).
Why? How can I make both these calls compatible?
This is because when you bind a function to a button you are not calling the function, only binding it so that tkinter knows what to do when the button is pressed. You only need to use func() when you are calling the function as you are doing in the the event.
What is the difference between "func" and "func()" in TkInter?