Commit 3a3ff16c by BellCodeEditor

save project

parent 4b6d7efe
Showing with 16 additions and 7 deletions
tuplel = (100,200) import os
x,y,z = tuplel a = 'C:\\Users\\XMBC\\Desktop\\a'
print('x的值是:',x) b = os.listdir(a)
print('y的值是:',y) print(b)
\ No newline at end of file \ No newline at end of file
import pygame import pygame
import os
from pygame import locals from pygame import locals
pygame.init() # 初始化 pygame.init() # 初始化
...@@ -12,10 +13,18 @@ last_img = pygame.image.load('last.png') # 上一曲按钮 ...@@ -12,10 +13,18 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮 next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo logo_img = pygame.image.load('logo.png') # 中间logo
pygame.mixer.music.load("a.mp3") pygame.mixer.music.load("a.mp3")
c=["a.mp3","b.mp3"] c=[]
tick = 0 tick = 0
a = 0.2 a = 0.2
b = play_img b = play_img
d = 'C:\\Users\\XMBC\\Desktop\\a'
f = os.listdir(d)
for i in f:
if i[-4:] == ".mp3":
c.append(i)
num = -1 num = -1
pygame.mixer.music.set_volume(a) pygame.mixer.music.set_volume(a)
while True: while True:
...@@ -50,7 +59,7 @@ while True: ...@@ -50,7 +59,7 @@ while True:
num +=1 num +=1
if num > len(c)-1: if num > len(c)-1:
num = 0 num = 0
pygame.mixer.music.load(c[num]) pygame.mixer.music.load(d + "//" + c[num])
pygame.mixer.music.play() 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