Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import subprocess
  2. import time
  3.  
  4. p = subprocess.Popen(['/bin/bash', '-c', 'mplayer http://173.239.76.147:8090'],
  5. stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=False,
  6. stderr=subprocess.STDOUT)
  7. time.sleep(5)
  8. p.kill()
  9.  
  10. p = subprocess.Popen(['/bin/bash', '-c', 'mplayer http://173.239.76.147:8090'],
  11. shell=False)
  12. time.sleep(5)
  13. p.kill()
  14.  
  15. import subprocess, time
  16.  
  17. p = subprocess.Popen(['mplayer', 'http://173.239.76.147:8090'])
  18. time.sleep(5)
  19. p.terminate()
  20. p.wait() # important!
  21.  
  22. subprocess.Popen(['reset']).wait()
  23.  
  24. print('Hello, World!')
  25.  
  26. #!/usr/bin/env python
  27. import shlex
  28. import time
  29. from subprocess import Popen, PIPE
  30.  
  31. cmd = shlex.split("mplayer http://www.swissradio.ch/streams/6034.m3u")
  32. p = Popen(cmd, stdin=PIPE)
  33. time.sleep(5)
  34. p.communicate(b'q')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement