default second frame __init__(selfself msecs msecs self pack(stopper button(selftext='stop the beeps!'command=self quitstopper pack(stopper config(bg='navy'fg='white'bd= self stopper stopper self repeater(def repeater(self)self bell(self stopper flash(self after(self msecsself repeateron every millisecs beep now flash button now reschedule handler if __name__ ='__main__'alarm(msecs= mainloop(this script builds the window in figure - and periodically calls both the button widget' flash method to make the button flash momentarily (it alternates colors quicklyand the tkinter bell method to call your system' sound interface the repeater method beeps and flashes once and schedules callback to be invoked after specific amount of time with the after method figure - stop the beepsbut after doesn' pause the callercallbacks are scheduled to occur in the backgroundwhile the program performs other processing--technicallyas soon as the tk event loop is able to notice the time rollover to make this workrepeater calls after each time throughto reschedule the callback delayed events are one-shot callbacksto repeat the event as loopwe need to reschedule it anew the net effect is that when this script runsit starts beeping and flashing once its onebutton window pops up and it keeps beeping and flashing and beeping and flashing other activities and gui operations don' affect it even if the window is iconifiedthe beeping continuesbecause tkinter timer events fire in the background you need to kill the window or press the button to stop the alarm by changing the msecs delayyou can make this beep as fast or as slow as your system allows (some platforms can' beep as fast as others this may or may not be the best demo to launch in crowded officebut at least you've been warned tkinter tourpart