Skip to main content

Posts

Showing posts from September, 2021

How to make a alarm clock in python | Alarm clock in python GUI

 Alarm Clock Well as a student we need the alarm clock most. We have already our mobile phones to set our alarm.But think like a coder we can make it by our own and can customize it and it is very fun.So open your ide and start building this amazing project. Just enjoy your code. Required Module from   tkinter   import  *   import   datetime import   time import   winsound Make the main function for the alarm def   alarm ():      while   True :          set_time  =  f " { hours . get () } :  { minute . get () } :  { seconds . get () } "          time . sleep ( 1 )          current_time  =  datetime . datetime . now (). strftime ( "%H:%M:%S" )          if   set_time  ==  current_time :              print ( "get up" )              winsound . PlaySound ( "sound.wav" , winsound . SND_ASYNC )          else :              break Create the root for tkinter use root  =  Tk () root . geometry ( "500x400" ) root . title ( "Alarm clock in pyt