Playback starts YouTube’s embedded player (privacy-enhanced mode).
Beginner Python Tutorial - Alarm with MP3 Sound Notification
ChannelSelf Proclaimed EngineerDescription from the creator
Super simple, easy to understand code walked through step by step to produce an alarm clock in Python - all with only 18 lines of code!
import os
import datetime
from playsound import playsound
from AppKit import NSSound
os. system('clear')
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? "))
os. system('clear')
print("Waiting for alarm",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("Time to wake up")
playsound('/your/path/to/file/beep-07.mp3')
break
import os
import datetime
from playsound import playsound
from AppKit import NSSound
os. system('clear')
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? "))
os. system('clear')
print("Waiting for alarm",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("Time to wake up")
playsound('/your/path/to/file/beep-07.mp3')
break
About this tutorial
Self Proclaimed Engineer published this 11:47 video tutorial on February 9, 2020. It has been watched 40,546 times on YouTube.
- Channel
- Self Proclaimed Engineer
- Category
- Education
- Duration
- 11:47
- Published
- February 9, 2020
- Views
- 40,546
- Likes
- 580
Tags
Share
This tutorial in other languages
- FRDébutant Python Tutorial - Alarme avec MP3 Notification sonore
- ESTutorial de Python para principiantes - Alarma con sonido MP3 Notificación
- PTBeginner Python Tutorial - Alarme com MP3 Sound Notificação
- ITPrincipiante Python Tutorial - Allarme con MP3 Suoni di notifica
- DEAnfänger Python Tutorial - Alarm mit MP3-Audiobenachrichtigung
- NLBeginner Python Tutorial - Alarm met MP3 Sound Notification
- RUНовичок Python Tutorial - сигнализация с MP3 Sound Notification
- PLPoczątkujący Python Tutorial - Alarm z MP3 powiadomienie dźwiękowe
- JA初心者Pythonのチュートリアル - MP3サウンド通知とアラーム
- ARالمبتدئين بيثون دروس - مع التنبيه MP3 إعلام الصوت
- HIशुरुआती अजगर ट्यूटोरियल - एमपी 3 ध्वनि अधिसूचना के साथ अलार्म
- IDPemula Python Tutorial - Alarm dengan MP3 Suara Pemberitahuan