Commit d51e8d0a by BellCodeEditor

save project

parent 372f614f
Showing with 10 additions and 1 deletions
import pygame
from pygame import locals
import os
music_list=[]
num=-1
path="C:\\Users\\Administrator\\Desktop\\test (1)"
filelist=os.listdir(path)
for file in filelist:
if file[-4:]==".wav"or file[-4:]==".ogg":
music_list.append(file)
pygame.init() # 初始化
# 创建窗口
......@@ -56,7 +65,7 @@ while True:
num+=1
if num>len(music_list)-1:
num=0
pygame.mixer_music.load(music_list[num])
pygame.mixer_music.load(path+"//"+music_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