Table of Contents
Python program to demonstrate Button in tkinter
Simple and easy python program to demonstrate Button and its single click and double click events in tkinter.
tkinter Button bind event
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #bind event from tkinter import * root=Tk() def hello(event): print("single click,Button-1") def quit(event): print("double click,so lets stop") import sys; sys.exit() widget=Button(root,text="Mouse clicks") widget.pack() widget.bind('<Button-1>',hello) widget.bind('<Double-1>',quit) root.mainloop() |
Output


We are aiming to explain all concepts of python in easiest terms as possible.

ITVoyagers
Author
PRACTICALS/PRACTICE PROGRAM IN PYTHON
CHECKOUT OTHER RELATED TOPICS
CHECKOUT OTHER QUIZZES
Quizzes on File Handling |
Easy quiz on file handling in python part 1 |
Easy quiz on file handling in python part 2 |
Quizzes on Exception Handling |
Easy quiz on Exception Handling in python part 1 |
Easy Quiz on Exception Handling in python part 2 |
Quizzes on Regular Expressions |
Easy Quiz on Regular Expression in python part 1 |
Quizzes on Python concepts coming soon… |
Python basic quiz |
New and easy python quiz basic part 1 |
New and easy python quiz (basic) part 2 |
New and easy python quiz (basic) part 3 |
Python practice quiz set |
Best Practice Quiz Set on Python Programming Part 1 |
Best Practice Quiz Set on Python Programming Part 2 |
Best Practice Quiz Set on Python Programming Part 3 |
Best Practice Quiz Set on Python Programming Part 4 |
Best Practice Quiz Set on Python Programming Part 5 |