Alarm Clock in Python with GUI | Alarm Clock Using Tkinter | How to Make Alarm Click Project in Python - Codexashish

Alarm Clock using Python Tkinter

In this tutorial, we are going to make an Alarm Clock in Python with GUI. We will use Tkinter for GUI. Now let's go:

Alarm Clock in Python Programming

Alarm Clock in Python with GUI

In this python project, we will use the Tkinter module to make an Alarm Clock in Python with GUI. Alarm Clock Project in Python Programming. Python Project for beginners. Python Project Alarm Clock.

Discover More

How to Become DevOps Engineer in 2023?

DevOps vs MLOps vs AIOps

How to Become Data Analytics?

AWS Learning Roadmap 2023

Data Structure Roadmap 2023

Code:-

from tkinter import *

from tkinter import messagebox

import time, sys

from pygame import mixer

from PIL import Image, ImageTk


def alarm():

alarm_time=user_input.get()

if alarm_time=="":

messagebox.askretrycancel("Error Message","Please Enter Value")

else:

while True:

time.sleep(1)

if (alarm_time==time.strftime("%H:%M")):

playmusic()

def playmusic():

mixer.init()

mixer.music.load('crock.mp3')

mixer.music.play()

while mixer.music.get_busy():

time.sleep(30)

mixer.music.stop()

sys.exit()









root=Tk()

root.title("Alarm Clock")

root.geometry("600x380")

canvas=Canvas(root,width=600,height=380)

image=ImageTk.PhotoImage(Image.open("bgimg.png"))

canvas.create_image(0,0,anchor=NW,image=image)

canvas.pack()

header=Frame(root)


box1=Frame(root)

box1.place(x=250,y=180)

box2=Frame(root)

box2.place(x=250,y=260)

#Time taken by User as Input

user_input=Entry(box1,font=('Arial Narrow',20),width=8)

user_input.grid(row=0,column=2)

#Set Alarm Button

start_button=Button(box2,text="Set Alarm",font=('Arial Narrow',16,'bold'),command=alarm)

start_button.grid(row=2,column=2)



root.mainloop()

If you want to download this code then let me know through my social media.

Conclusion:

We have created the Alarm Clock Project in Python Programming with GUI. Alarm Clock Python Project with GUI. Simple Python Projects.

Do you have any queries related to This Article, Please mention them in the Comment Section of this Article, We will contact you soon.

Thank you for reading this blog. I wish you the best in your journey in learning and mastering Python Programming.

Follow me to receive more useful content:

Instagram | Twitter | Linkedin | Youtube

Thank you

People are also reading:-

Ashish Yadav

Hi, I am Ashish Yadav, The founder of the codexashish.com website. I am a Data Analyst by profession and a Blogger, and YouTuber by choice and I love sharing my knowledge with needy people like You. I love coding and blogging.

Post a Comment (0)
Previous Post Next Post