Created
December 31, 2022 23:53
-
-
Save matejmajny/69944b10adb924d37c61025d7764ba66 to your computer and use it in GitHub Desktop.
new year thingy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# overcomplicated but works | |
from datetime import datetime | |
from threading import Timer | |
import pygame, time | |
x=datetime.today() | |
y=x.replace(day=x.day, hour=23, minute=58, second=58, microsecond=5) | |
delta_t=y-x | |
secs=delta_t.seconds+1 | |
def program(): | |
pygame.mixer.init() | |
pygame.mixer.music.load(r"C:\Users\matej\Downloads\xenogenesis.mp3") | |
pygame.mixer.music.play() | |
time.sleep(120) | |
t = Timer(secs, program) | |
t.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment