-
Notifications
You must be signed in to change notification settings - Fork 0
/
play_music.py
35 lines (32 loc) · 879 Bytes
/
play_music.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# import pygame
# pygame.init()
# song = pygame.mixer.Sound('abc.mp3')
# clock = pygame.time.Clock()
# song.play()
# while True:
# clock.tick(60)
# pygame.quit()
import pygame, sys, datetime
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((500, 400))
screen.fill((49, 26, 65))
pygame.display.set_caption("TESTIFICATE")
if datetime.date.today().month == 12 and datetime.date.today().day == 25:
pygame.mixer.music.load("abc.mp3")
print("Merry Christmas!")
else:
pygame.mixer.music.load("abc.mp3")
print("Loading Music...")
pygame.mixer.music.play(-1, 0.0)
print("Playing Background Music...")
while True:
filename = "clock.png"
img = pygame.image.load(filename)
screen.blit(img,(100,60))
pygame.display.flip()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.update()