Tkinter bell() विधि सिस्टम की डिफ़ॉल्ट घटना या संवाद ध्वनि उत्पन्न करती है। इस विधि को डिफ़ॉल्ट विंडो या फ्रेम में लागू किया जा सकता है। हम सिस्टम कॉन्फ़िगरेशन में जाकर विंडो की ध्वनि को बदल सकते हैं।
इस उदाहरण में, हम एक बटन बनाएंगे जो डिफ़ॉल्ट ध्वनि बनाएगा।
उदाहरण
#Import the library
from tkinter import *
#Create an instance of tkinter frame
win= Tk()
#Define the size of the window
win.geometry("700x150")
win.resizable(0,0)
#Define the Bell function
def click():
win.bell()
Button(win,text= "Click Me", command= click).pack(pady=20)
win.mainloop() आउटपुट
उपरोक्त कोड को चलाने से एक बटन बनेगा और उस पर क्लिक करने से सिस्टम की ध्वनि उत्पन्न होगी।
