Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson4_diy4
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3a3ff16c
authored
Mar 03, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4b6d7efe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
1.py/1.py
my_music.py
1.py/1.py
View file @
3a3ff16c
tuplel
=
(
100
,
200
)
x
,
y
,
z
=
tuplel
print
(
'x的值是:'
,
x
)
print
(
'y的值是:'
,
y
)
\ No newline at end of file
import
os
a
=
'C:
\\
Users
\\
XMBC
\\
Desktop
\\
a'
b
=
os
.
listdir
(
a
)
print
(
b
)
\ No newline at end of file
my_music.py
View file @
3a3ff16c
import
pygame
import
os
from
pygame
import
locals
pygame
.
init
()
# 初始化
...
...
@@ -12,10 +13,18 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img
=
pygame
.
image
.
load
(
'next.png'
)
# 下一曲按钮
logo_img
=
pygame
.
image
.
load
(
'logo.png'
)
# 中间logo
pygame
.
mixer
.
music
.
load
(
"a.mp3"
)
c
=
[
"a.mp3"
,
"b.mp3"
]
c
=
[]
tick
=
0
a
=
0.2
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
pygame
.
mixer
.
music
.
set_volume
(
a
)
while
True
:
...
...
@@ -50,7 +59,7 @@ while True:
num
+=
1
if
num
>
len
(
c
)
-
1
:
num
=
0
pygame
.
mixer
.
music
.
load
(
c
[
num
])
pygame
.
mixer
.
music
.
load
(
d
+
"//"
+
c
[
num
])
pygame
.
mixer
.
music
.
play
()
# 绘制画面
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment