I am making an alarm clock program that will have to sleep (Not make noise) until 6:00AM. The problem I am having is that I cannot get the program to wait X seconds
Pseudo Code: X = 6:00AM - CurrentTime time.sleep(X)
Here is my code so far:
#Imports
import datetime
import time
import pygame
WORDS = ["Wake", "Me", "Tommorow"]
#Make J.A.R.V.I.S. Listen
mic.activeListen():
#Determine time and difference of time
x = datetime.datetime.now()
x = x.total_seconds
print(x)
x = datetime.timedelta()
x = float(x) #time.sleep() Requires a float value.
time.sleep(x) #Sleeps until 6:00 AM
pygame.mixer.init()
pygame.mixer.music.load("alarm.mp3")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True: