Sedang Disiapkan

218543 Modify Alarm code using python

The code below is a visual alarm which is switched off by clicking on a button. I need this code extended to do the following 3 things:

- Allow the user to schedule the alarm to go off at a perticular time

- Allow the user to schedule the alarm to go off at given intervals (for exampl every half hour)

- Allow the user to schedule several alarms to go off at various times during the day.

I would also appriciate it if you could vaguely explain what the code you have added is doing. The alarm code is as follows:


from Tkinter import *

class Alarm(Frame):

def repeater(self): # on every N millisecs

[url removed, login to view]() # beep now

[url removed, login to view]() # flash button now

[url removed, login to view]([url removed, login to view], [url removed, login to view]) # reschedule handler

def __init__(self, msecs=1000): # default = 1 second


[url removed, login to view] = msecs

[url removed, login to view]()

stopper = Button(self, text='Stop the beeps!', command=[url removed, login to view])

[url removed, login to view]()

[url removed, login to view](bg='navy', fg='white', bd=8)

[url removed, login to view] = stopper

[url removed, login to view]()

if __name__ == '__main__': Alarm(msecs=1000).mainloop()

Kemahiran: Semua Boleh, Python

Lihat lebih lanjut: code 8, python c, modify code, modify python, bd, alarm, import modify, things need modify, visual schedule, repeater, python code, code import, handler, bin pack, code command, stop flash times, alarms, text python, times stop flash, time python, modify text python, python modify text, python modify, explain code, modify flash text

Tentang Majikan:
( 0 ulasan )

ID Projek: #1964776