Skip to content Skip to sidebar Skip to footer

(tkinter) Command Executed Automatically When Binding, Binding Not Acting As Expected

I am trying to bind a key to a command conditionally. But when I bind, the command gets automatically executed (when I toggle both commands). Why does that happen? And how can I on

Solution 1:

Omit the ().

When you do this:

editor.bind('<Return>', br_and_p())

... You are immediately executing the function br_and_ p, and binding the result of that function to the event.

Post a Comment for "(tkinter) Command Executed Automatically When Binding, Binding Not Acting As Expected"