Why is button parameter “command” executed when declared?
Answer / Kishore
In Tkinter, a Python library for creating GUI applications, the 'command' parameter of a button widget is executed immediately upon declaration if a function or lambda expression is provided. This happens because Tkinter processes all the events (like clicking a button) in the background as soon as they are bound to their respective events. If you don't want the command to be executed right away, you can delay it by placing the code for the command inside a function.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is format () in python?
What is Python Decorator?
Tell us what is the usage of help() and dir() function in python?
What is dogpile mechanism? Explain.
What is the shortest method to open a text file and display its content?
Is node better than python?
What is python interpreter?
What is zip() function in python?
Point out the use of help() function?
Is r easier than python?
What are dict and list comprehensions?
How would you define a block in python?