My Alarm For Programmers Program source code :

 

import datetime,time
from pygame import mixer


def gettime():
    return datetime.datetime.now()

def get_time_45min():
    x = str(datetime.datetime.now) + str(datetime.timedelta(seconds= 5 ))
    print(x)


#Water Function
def water():
    while(True):
        mixer.init()
        mixer.music.load("water.mp3")
        time.sleep(1800)#upon you
        mixer.music.play(loops= 50)
        take_input = (input('write Drank Here : '))
       
        if take_input == "drank":
            mixer.music.stop()
            with open("water.txt", "a") as op:
                op.write(str([str(gettime())]) + ": " + take_input + "\n")
                mixer.quit()
        break
           
           
       

    #Eyes Function
    while(True):
        mixer.init()
        time.sleep(600)#upon you
        mixer.music.load("eyes.mp3")
        mixer.music.play(loops= 50 )
        take_input = input('write Done Here : ')
       
        if take_input == "done":
            mixer.music.stop()
            with open("eyes.txt", "a") as op:
                op.write(str([str(gettime())]) + ": " + take_input + "\n")
                mixer.quit()
            break
   

    #pysical Function
    while(True):
        mixer.init()
        time.sleep(300)#upon you
        mixer.music.load("physical.mp3")
        mixer.music.play(loops= 50 )
        take_input = input('write done here : ')
        if take_input == "done":
            mixer.music.stop()
            with open("physical.txt", "a") as op:
                op.write(str([str(gettime())]) + ": " + take_input + "\n")
                mixer.quit()
        break        
           
            # if take_input == "done" :
            #     mixer.quit()
            #     print("successfully written")


while(True):
    water()









   
       


Post a Comment

Previous Post Next Post