Sedang Disiapkan

218630 Alarm 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, python, python c++, python c, bd, alarm, using class, visual schedule, python class, repeater, python code, handler, bin pack, stop flash times, Alarms, text python, times stop flash, time python, flash python, alarm code, button using code, user extended

Tentang Majikan:
( 0 ulasan )

ID Projek: #1964863