Open In App

Tkinter – bell() method

Improve
Improve
Like Article
Like
Save
Share
Report

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.

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 module
from tkinter import *
  
# Create object
root = Tk()
  
# Adjust size
root.geometry("400x400")
  
# Bell function
def bell():
    # call bell method
    root.bell()
  
# Add button
Button(root,text="Bell",command=bell).pack()
  
# Execute tkinter
root.mainloop()


Output:


Last Updated : 11 Dec, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads