- 论坛徽章:
- 0
|
- #coding:cp936
- import time,winsound
- time=time.localtime()
- h=time[3]
- m=time[4]
- def sound(wav):
- path="sound\\%s.wav" % wav
- winsound.PlaySound(path,winsound.SND_NODEFAULT)
- th=str(h)
- lenth=len(th)
- th0=th[0]
- if lenth==2:
- th1=th[1]
- tm=str(m)
- lentm=len(tm)
- tm0=tm[0]
- if lentm==2:
- tm1=tm[1]
-
- sound("now")
- if lenth==1:
- sound(th)
- elif lenth==2 and th=="10":
- sound("10")
- elif lenth==2 and th=="20":
- sound("2")
- sound("10")
- elif lenth==2 and h<20:
- sound("10")
- sound(th1)
- elif lenth==2 and h>20:
- sound(th[0])
- sound("10")
- sound(th[1])
- else:
- print "I服了YOU!"
- sound("hour")
- if m==0:
- sound("just")
- elif m==10:
- sound("10")
- sound("minute")
- elif m>10 and tm1=="0":
- sound(tm0)
- sound("10")
- sound("minute")
- elif m<10 and m!=0:
- sound("0")
- sound(tm0)
- sound("minute")
- elif m>10 and m<20:
- sound("10")
- sound(tm1)
- sound("minute")
- elif m>20:
- sound(tm0)
- sound("10")
- sound(tm1)
- sound("minute")
复制代码 |
|