Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- from Tkinter import *
- port = 8081
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- class App:
- def __init__(self, master):
- frame = Frame(master)
- frame.pack()
- self.e = Entry(frame)
- self.e.pack(side=LEFT)
- self.button = Button(frame, text="quit", command=frame.quit)
- self.button.pack(side=LEFT)
- self.hi_there = Button(frame, text="play", command=self.play)
- self.hi_there.pack(side=LEFT)
- self.hi_there = Button(frame, text="pause", command=self.pause)
- self.hi_there.pack(side=LEFT)
- self.hi_there = Button(frame, text="play next", command=self.next)
- self.hi_there.pack(side=LEFT)
- self.hi_there = Button(frame, text="play previous", command=self.previous)
- self.hi_there.pack(side=LEFT)
- def play(self):
- host = self.e.get()
- num = '1'
- s.sendto((num), (host, port))
- def pause(self):
- host = self.e.get()
- num = '2'
- s.sendto((num), (host, port))
- def next(self):
- host = self.e.get()
- num = '3'
- s.sendto((num), (host, port))
- def previous(self):
- host = self.e.get()
- num = '4'
- s.sendto((num), host, port)
- root = Tk()
- app = App(root)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement