We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 392a22b + df939a6 commit cb75fbcCopy full SHA for cb75fbc
Basic Scripts/Alarm_Clock.py
@@ -0,0 +1,21 @@
1
+from datetime import datetime
2
+from playsound import playsound
3
+alarm_time = input("Enter the time of alarm to be set:HH:MM:SS\n")
4
+alarm_hour=alarm_time[0:2]
5
+alarm_minute=alarm_time[3:5]
6
+alarm_seconds=alarm_time[6:8]
7
+alarm_period = alarm_time[9:11].upper()
8
+print("Setting up alarm..")
9
+while True:
10
+ now = datetime.now()
11
+ current_hour = now.strftime("%I")
12
+ current_minute = now.strftime("%M")
13
+ current_seconds = now.strftime("%S")
14
+ current_period = now.strftime("%p")
15
+ if(alarm_period==current_period):
16
+ if(alarm_hour==current_hour):
17
+ if(alarm_minute==current_minute):
18
+ if(alarm_seconds==current_seconds):
19
+ print("Wake Up! It's time!")
20
+ playsound('audio.mp3')
21
+ break
0 commit comments