Tkinter – bell() method
Prerequisite: Python GUI – tkinter
Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create the GUI applications. Creating a GUI using tkinter is an easy task.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
In this article, We will learn about the bell() method in Tkinter.
This method rings the bell on the display for window and returns an empty string. The Tkinter bell() is the default sound of the operating system, to change the bell sound in the Tkinter application, one needs to got system sound settings and needs to change the default sound.
Syntax:
Object_name.bell()
Implementation:
Python3
# Import modulefrom tkinter import * # Create objectroot = Tk() # Adjust sizeroot.geometry("400x400") # Bell functiondef bell(): # call bell method root.bell() # Add buttonButton(root,text="Bell",command=bell).pack() # Execute tkinterroot.mainloop() |
Output:


