We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22becef commit 9954281Copy full SHA for 9954281
Numbers/alarm.py
@@ -1,10 +1,15 @@
1
"""
2
Alarm Clock - A simple clock where it plays a sound after
3
X number of minutes/seconds or at a particular time.
4
+
5
+Dependencies:
6
+pyglet
7
+ pip install pyglet
8
9
10
import time
11
import winsound
12
+import pyglet
13
14
if __name__ == '__main__':
15
hh = input('What hour do you want to wake up (0-23)? ')
@@ -17,6 +22,8 @@
17
22
hour = cur_time[3] # find the hour
18
23
minute = cur_time[4] # and the minute
19
24
if hour == hh and minute == mm:
20
- winsound.Beep(10000, 100) # play the beep
25
+ song = pyglet.media.load('bin/sound.wav')
26
+ song.play() # play the sound
27
+ pyglet.app.run()
21
28
not_alarmed = 0 # stop the loop
29
0 commit comments