Commit 305038b7 by BellCodeEditor

save project

parent d10f44ac
Showing with 18 additions and 9 deletions
a=(1,2,3) # a=(1,2,3)
x,y,z=a # x,y,z=a
print(x) # print(x)
print(y) # print(y)
print(z) # print(z)
\ No newline at end of file
import os
pant='C:\\Users\\123\\Desktop\\刘泽宇 python\\test'
f=os.listdir(pant)
import pygame import pygame
import os
from pygame import locals from pygame import locals
pygame.init() # 初始化 pygame.init() # 初始化
...@@ -13,8 +14,13 @@ next_img = pygame.image.load('next.png') # 下一曲按钮 ...@@ -13,8 +14,13 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 中间logo logo_img = pygame.image.load('logo.png') # 中间logo
mb=['mb2.mp3','mb4.mp3','mb3.mp3','mb.mp3'] mb=['mb2.mp3','mb4.mp3','mb3.mp3','mb.mp3']
m=-1 pant='C:\\Users\\123\\Desktop\\刘泽宇 python\\test'
f=os.listdir(pant)
for i in f:
if i[-4:]=='mp3':
mb.append(i)
m=-1
volume=0.2 volume=0.2
pygame.mixer.music.set_volume(volume) pygame.mixer.music.set_volume(volume)
click=0 click=0
...@@ -53,8 +59,8 @@ while True: ...@@ -53,8 +59,8 @@ while True:
m+=1 m+=1
if m>len(mb)-1: if m>len(mb)-1:
m=0 m=0
pygame.mixer.music.load(mb[m]) pygame.mixer.music.load(pant+'\\'+mb[m])
pygame.mixer.music.play() pygame.mixer.music.play()
# 绘制画面 # 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景 screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(play_button, (270, 330)) # 暂停按钮 screen.blit(play_button, (270, 330)) # 暂停按钮
......
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