Commit ad8ebfe0 by BellCodeEditor

save project

parent 45e60493
Showing with 7 additions and 1 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import os
we=os.listdir('C:\\Users\\Administrator\\Desktop')
we=[]
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
...@@ -54,6 +56,10 @@ while True: ...@@ -54,6 +56,10 @@ while True:
if pygame.mixer.music.get_busy() == False: if pygame.mixer.music.get_busy() == False:
list_number += 1 list_number += 1
for path in we:
path[-4:]="mp3"
we.append(path)
print(we)
if list_number>len(music_list)-1: if list_number>len(music_list)-1:
list_number=0 list_number=0
pygame.mixer.music.load(music_list[list_number]) pygame.mixer.music.load(music_list[list_number])
......
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