From 61a60af81616e504c38387f24a8638c1573b0381 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 5 Jun 2022 13:19:09 +0800 Subject: [PATCH] save project --- my_music.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/my_music.py b/my_music.py index a30c4ce..c5af2e6 100644 --- a/my_music.py +++ b/my_music.py @@ -13,7 +13,8 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 logo_img = pygame.image.load('logo.png') # 下一曲按钮 n=-1 ml=[] -f=os.listdir("C:\\Users\\6\\Desktop\\test") +p="C:\\Users\\6\\Desktop\\test\\" +f=os.listdir(p) # 载入音乐 for i in f: if f[-4:]==".wav"or f[-4:]==".ogg": @@ -53,12 +54,12 @@ while True: else: play_button = play_img pygame.mixer.music.pause() - + if pygame.mixer.music.get_busy() == False: n+=1 - if n>len(ml)-1: + if n>len(f)-1: n=0 - pygame.mixer.music.load("C:\\Users\\6\\Desktop\\test\\"+ml[n]) + pygame.mixer.music.load(p+"\\"+ml[n]) pygame.mixer.music.play() # 绘制画面 -- libgit2 0.25.0