Python音乐播放器
我们今天来制作一个音乐播放器。
代码
from tkinter import *
import tkinter.filedialog as fdl
import tkinter.messagebox as msg
import requests
import time
import pygame
import os
import eyed3
root=Tk()
pwd=os.getcwd()
pygame.init()
root.title("喜马拉雅_python")
root.geometry('300x300')
root.resizable(False, False)
music_num=0
first=True
pause=True
if not os.path.exists(pwd+"\\tmp"):
os.system("mkdir tmp")
elif os.path.isfile(pwd+"\\tmp"):
os.system("mkdir tmp")
def get_music_time(name):
pwd=os.getcwd()
music=eyed3.load(pwd+"\\tmp\\"+name)
sec=music.info.time_secs
return sec
def get_music(num):
global music_num
pwd=os