#filename my little alarm clock.
Import time
Import Sys
Import WinSound
A=time.ctime ()
Print ("***************** Pro is Now", A, "**********************")
Print ("*********************** welcome you to use Shup DIY alarm Clock applet ***********************")
Hour1=int (Input ("*****************", enter the hour you want to set the alarm (for example, 10): "))
Minutes=int (Input ("**************** Pro, please enter the minutes to set the alarm (e.g. 20):"))
i = 3
O=3
While I:
A= list (Time.localtime ()) #获取本地时间
hour = a[3]
minute = A[4]
If hour = = Hour1 and minute== minutes: # Make a judgment of the hint input
I-=1
While o:
WinSound. PlaySound ("Systemexit", WinSound. Snd_alias)
WinSound. PlaySound ("*", WinSound. Snd_alias)
O-=1
Print ("************************ Thank you for using, wish you have a happy mood!" ********************")
Print ("*********************** Thank you for using Shup DIY alarm applet ***********************")
This article is from the "Make a few" blog, be sure to keep this source http://9399369.blog.51cto.com/9389369/1610199
An interactive alarm clock written in Python