Skip to content

Instantly share code, notes, and snippets.

@matejmajny
Created December 31, 2022 23:53
Show Gist options
  • Save matejmajny/69944b10adb924d37c61025d7764ba66 to your computer and use it in GitHub Desktop.
Save matejmajny/69944b10adb924d37c61025d7764ba66 to your computer and use it in GitHub Desktop.
new year thingy
# 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