Commit 849565e0 by BellCodeEditor

save project

parent b54bc6ab
Showing with 3 additions and 2 deletions
......@@ -13,7 +13,8 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
list = []
file = os.listdir('C:\\Users\\6460b\\Desktop\\songs')
path = 'C:\\Users\\6460b\\Desktop\\songs'
file = os.listdir(path)
for i in file:
if i[-4:] == '.wav' or i[-4:] == '.ogg':
list.append(i)
......@@ -61,7 +62,7 @@ while True:
num += 1
if num == len(list)-1:
num = 0
pygame.mixer.music.load(list[num])
pygame.mixer.music.load(path + '\\' + list[num])
pygame.mixer.music.play()
# 绘制画面
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment