Guest User

Untitled

a guest
Jun 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import subprocess
  2. import sys
  3. from Tkinter import Tk, Button, mainloop
  4. from threading import Thread
  5.  
  6. master = Tk()
  7.  
  8. film = '/Volumes/speicher/Rise Of The Footsoldier/Rise of the Footsoldier - CD1.avi'
  9.  
  10. def start(film=film):
  11. global popen
  12. popen = subprocess.Popen(['mplayer', film],
  13. stdin=subprocess.PIPE,
  14. stdout=subprocess.PIPE)
  15.  
  16. def pause():
  17. popen.communicate('p')
  18.  
  19.  
  20. start_button = Button(master, text=u'Film starten', command=start)
  21. pause_button = Button(master, text=u'Film pausieren',
  22. command=lambda: Thread(target=pause).start())
  23. start_button.pack()
  24. pause_button.pack()
  25.  
  26. mainloop()
Add Comment
Please, Sign In to add comment