赞
踩
1,导入模块:
2,函数命令:
3,界面:
4,效果:
5,代码:
import tkinter as tk
from pygame import mixer
import time
def qwe():
r=e.get()
mixer.init()
mixer.music.load(r+'.mp3')
def asd():
mixer.music.play()
def zxc():
mixer.music.stop()
q=tk.Tk()
q.geometry('270x100')
q.title('music Player')
e=tk.Entry(q)
e.place(x=30,y=20)
w=tk.Button(q,text="搜索",command=qwe)
w.place(x=210,y=15)
t=tk.Button(q,text="播放",command=asd)
t.place(x=20,y=55)
y=tk.Button(q,text="停止",command=zxc)
y.place(x=100,y=55)
u=tk.Label(q,text="Listen to the music")
u.place(x=150,y=60)
q.mainloop()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。