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() 출력
위의 코드를 실행하면 버튼이 생성되고 그 위에 클릭하면 시스템 사운드가 생성됩니다.
