Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Tkinter – bell() method

  • Last Updated : 11 Dec, 2020

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 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:

My Personal Notes arrow_drop_up
Recommended Articles
Page :