Let's code an ALARM CLOCK in Python! ⏰

Video Player is loading.
Current Time 0:00
Duration -:-
Loaded: 0%
Stream Type LIVE
Remaining Time -:-
 
1x
8 Views
Published
#python #pythontutorial #pythoncourse

# Python Alarm Clock
import time
import datetime
import pygame


def set_alarm(alarm_time):
print(f"Alarm set for {alarm_time}")
sound_file = "my_music.mp3"
is_running = True

while is_running:
current_time = datetime.datetime.now().strftime("%H:%M:%S")
print(current_time)

if current_time == alarm_time:
print("WAKE UP!
Category
Bro Code
Tags
Python tutorial, python course, python programming
Show more
Be the first to comment