Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson6_diy2

  • This project
    • Loading...
  • Sign in
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 74046484 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 247067ec
Hide whitespace changes
Inline Side-by-side
Showing with 8 additions and 3 deletions
  • my_music.py
my_music.py
View file @ 74046484
...@@ -2,6 +2,7 @@ import pygame ...@@ -2,6 +2,7 @@ import pygame
from pygame import locals from pygame import locals
import os import os
import Surface import Surface
pygame.mixer.Sound()
FPS = pygame.time.Clock() FPS = pygame.time.Clock()
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
...@@ -90,7 +91,11 @@ while True: ...@@ -90,7 +91,11 @@ while True:
play_s=play_time%60 play_s=play_time%60
info = str(play_m) + ":" +str(play_s) info = str(play_m) + ":" +str(play_s)
Sound.get_length()
music_m = play_lengh//60
music_s = play_lengh%60
if play_s < 10:
play_s = "0" +str(play_s)
...@@ -107,4 +112,5 @@ while True: ...@@ -107,4 +112,5 @@ while True:
screen.blit(last_img, (120, 350)) # 上一曲 screen.blit(last_img, (120, 350)) # 上一曲
screen.blit(next_img, (420, 350)) # 下一曲 screen.blit(next_img, (420, 350)) # 下一曲
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
\ No newline at end of file pygame.mixer.music()
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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