Let's code an ALARM CLOCK in Python! ⏰

75 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
Be the first to comment