Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson6_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
44fe4904
authored
3 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ae4aa574
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
my_music.py
my_music.py
View file @
44fe4904
...
@@ -15,7 +15,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
...
@@ -15,7 +15,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
basiic_font
=
pygame
.
font
.
Font
(
'neuropol.ttf'
,
14
)
basiic_font
=
pygame
.
font
.
Font
(
'neuropol.ttf'
,
14
)
music_list
=
[]
music_list
=
[]
path
=
"C:
\\
Users
\\
Administrator
\\
Desktop
\
\
text"
path
=
r"C:\Users\Administrator\Desktop
\text"
filelist
=
os
.
listdir
(
path
)
filelist
=
os
.
listdir
(
path
)
num
=
-
1
num
=
-
1
for
i
in
filelist
:
for
i
in
filelist
:
...
@@ -99,13 +99,20 @@ while True:
...
@@ -99,13 +99,20 @@ while True:
play_time
=
int
(
play_time
/
1000
)
play_time
=
int
(
play_time
/
1000
)
play_m
=
play_time
//
60
play_m
=
play_time
//
60
play_s
=
play_time
%
60
play_s
=
play_time
%
60
if
play_m
<
10
:
play_m
=
'0'
+
str
(
play_m
)
if
play_s
<
10
:
if
play_s
<
10
:
play_s
=
'0'
+
str
(
play_s
)
play_s
=
'0'
+
str
(
play_s
)
info
=
str
(
play_m
)
+
':'
+
str
(
play_s
)
info
=
str
(
play_m
)
+
':'
+
str
(
play_s
)
music_m
=
music_length
//
60
music_m
=
music_length
//
60
music_s
=
music_length
%
60
music_s
=
music_length
%
60
if
music_m
<
10
:
music_m
=
'0'
+
str
(
music_m
)
if
music_s
<
10
:
if
music_s
<
10
:
music_s
=
'0'
+
str
(
music_s
)
music_s
=
'0'
+
str
(
music_s
)
info2
=
str
(
music_m
)
+
':'
+
str
(
music_s
)
info2
=
str
(
music_m
)
+
':'
+
str
(
music_s
)
...
@@ -124,7 +131,7 @@ while True:
...
@@ -124,7 +131,7 @@ while True:
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
screen
.
blit
(
next_img
,
(
420
,
350
))
# 下一曲
scoreSurf
=
basiic_font
.
render
(
info
,
True
,(
225
,
225
,
225
))
scoreSurf
=
basiic_font
.
render
(
info
,
True
,(
225
,
225
,
225
))
screen
.
blit
(
scoreSurf
,
(
120
,
440
))
screen
.
blit
(
scoreSurf
,
(
120
,
440
))
scoreSurf2
=
basiic_font
.
render
(
'
/'
+
info
,
True
,(
225
,
225
,
225
))
scoreSurf2
=
basiic_font
.
render
(
'
/'
+
info2
,
True
,(
225
,
225
,
225
))
screen
.
blit
(
scoreSurf2
,
(
170
,
440
))
screen
.
blit
(
scoreSurf2
,
(
170
,
440
))
# 刷新画面
# 刷新画面
pygame
.
display
.
update
()
pygame
.
display
.
update
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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