|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#author:毛毛雨
from tkinter import *
import socket
yipin_address=('localhost',41235)
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
def execute(msg):
msg1=msg.encode('utf-8')
print(msg1)
s.sendto(msg1,yipin_address)
list=["B004D100010E","B004D200011E","B004D300012E","B003D100110E","B003D100211E","B003D100312E","B003D100413E","B003D100514E","B003D100615E","B003D100716E","B003D100817E","B003D100918E"]
root = Tk()
frame1 = Frame(root)
frame2 = Frame(root)
frame3 = Frame(frame2)
frame4 = Frame(frame2)
root.title('易拼控制')#给窗口的可视化起名字
root.geometry('500x300')#设置窗口的大小
hi_there = Button(frame1,text="播放",width=15,height=3,font=('12'),command=execute(list[0]))
hi_there.pack()
hi_these = Button(frame1,text="暂停",width=15,height=3,font=('12'),command=execute(list[1]))
hi_these.pack()
hi_these = Button(frame1,text="停止",width=15,height=3,font=('12'),command=execute(list[2]))
hi_these.pack()
hi_there = Button(frame1,text="下一个",width=15,height=3,font=('12'),command=execute(list[3]))
hi_there.pack()
hi_these = Button(frame3,text="影片一",width=15,height=2,font=('12'),command=execute(list[4]))
hi_these.pack()
hi_these = Button(frame3,text="影片二",width=15,height=2,font=('12'),command=execute(list[5]))
hi_these.pack()
hi_these = Button(frame3,text="影片三",width=15,height=2,font=('12'),command=execute(list[6]))
hi_these.pack()
hi_these = Button(frame3,text="影片四",width=15,height=2,font=('12'),command=execute(list[7]))
hi_these.pack()
hi_these = Button(frame4,text="影片五",width=15,height=2,font=('12'),command=execute(list[8]))
hi_these.pack()
hi_these = Button(frame4,text="影片六",width=15,height=2,font=('12'),command=execute(list[9]))
hi_these.pack()
hi_these = Button(frame4,text="影片七",width=15,height=2,font=('12'),command=execute(list[10]))
hi_these.pack()
hi_these = Button(frame4,text="影片八",width=15,height=2,font=('12'),command=execute(list[11]))
hi_these.pack()
frame1.pack(padx=3,pady=3,side=LEFT)
frame2.pack(padx=3,pady=3,side=RIGHT)
frame3.pack(padx=10,pady=10,side=LEFT)
frame4.pack(padx=10,pady=10,side=RIGHT)
root.mainloop() |
|