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 lagi: python button, code 8, python, python c++, python c, modify code, modify a python, bd, alarm, import modify, things need modify, using class, visual schedule, python class, repeater, python code, code import, handler, bin pack, code command, stop flash times, Alarms, text python, times stop flash, time python

Tentang Majikan:
( 0 ulasan )

ID Projek: #1964776