8000 alarm by sneha2180 · Pull Request #202 · souravjain540/Basic-Python-Programs · GitHub
[go: up one dir, main page]

Skip to content
Closed

alarm #202

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions alarm/alarm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
import datetime
from playsound import playsound

alarmH = int(input("What hour do you want the alarm to ring? "))
alarmM = int(input("What minute do you want the alarm to ring? "))
amPm = str(input("am or pm? "))

print("Waiting for alarm at ",alarmH,alarmM,amPm)
if (amPm == "pm"):
alarmH = alarmH + 12
while(1 == 1):
if(alarmH == datetime.datetime.now().hour and
alarmM == datetime.datetime.now().minute) :
print("Rise and Shine :) ")
playsound('./sound.mp3')
break
Binary file added alarm/sound.mp3
Binary file not shown.
0