Skip to content

Instantly share code, notes, and snippets.

@jayrambhia
Created February 1, 2012 20:48
Show Gist options
  • Save jayrambhia/1719217 to your computer and use it in GitHub Desktop.
Save jayrambhia/1719217 to your computer and use it in GitHub Desktop.
A python script to play banshee media player(can use only terminal commands).
'''
Author : Jay Rambhia
email : [email protected]
twitter: @jayrambhia
'''
import os
import time
import threading
import sys
from multiprocessing import Process
def banshee():
os.system('banshee --play')
return
class do(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
try:
command_str = str(raw_input('Command: '))
if command_str == 'quit':
os.system('banshee --stop')
return
os.system('banshee --'+command_str)
print command_str
self.run()
except EOFError:
print 'Got keyboard interrupt'
print 'quitting'
os.system('banshee --stop')
return
def main():
p = Process(target = banshee)
p.start()
command = do()
command.start()
command.join()
p.terminate()
print 'terminate'
if __name__ == '__main__':
main()
'''
Author : Jay Rambhia
email : [email protected]
twitter: @jayrambhia
'''
import os
import time
import threading
import sys
from multiprocessing import Process
def banshee(playlist):
# playlist = raw_input('playlist: ')
os.system('banshee '+playlist+' --fullscreen')
return
class do(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
try:
command_str = str(raw_input('Command: '))
if command_str == 'quit':
os.system('banshee --stop')
return
os.system('banshee '+command_str)
print command_str
self.run()
except EOFError:
print 'Got keyboard interrupt'
print 'quitting'
os.system('banshee --stop')
return
def main():
#playlist = raw_input('playlist :')
playlist = 'playlist_name'
p = Process(target = banshee, args=(playlist,))
p.start()
command = do()
command.start()
command.join()
p.terminate()
print 'terminate'
if __name__ == '__main__':
main()
@jayrambhia
Copy link
Author

And now commands would be
--play
--pause
etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment