willprice / python-omxplayer-wrapper

:tv: Control OMXPlayer, the Raspberry Pi media player, from Python
http://python-omxplayer-wrapper.readthedocs.io
GNU Lesser General Public License v3.0
253 stars 71 forks source link

how to I add args? #34

Closed electricgraphy closed 9 years ago

electricgraphy commented 9 years ago

Hi sorry for a stupid ask but I really don't know about python..

player = OMXPlayer('/home/pi/03.mp4', args=['--no-osd'])

I want to add another args, for example '-o local'. I tried like this but it does not work.

player = OMXPlayer('/home/pi/03.mp4', args=['--no-osd','-o local'])

can you help me? thank you very much.

willprice commented 9 years ago

Hi,

You have to obey the shell word splitting rules, you can use the shlex library to split a string of args into an array of words the same as how the shell would split them.

Your mistake is to include local with -o, you want [ '-o', 'local' ]

On Sun, 20 Sep 2015 16:02 electricgraphy notifications@github.com wrote:

Hi sorry for a stupid ask but I really don't know about python..

player = OMXPlayer('/home/pi/03.mp4', args=['--no-osd'])

I want to add another args, for example '-o local'. I tried like this but it does not work.

player = OMXPlayer('/home/pi/03.mp4', args=['--no-osd','-o local'])

can you help me? thank you very much.

— Reply to this email directly or view it on GitHub https://github.com/willprice/python-omxplayer-wrapper/issues/34.

electricgraphy commented 9 years ago

Thanks for your quick reply. I tried again as your replay, like this:

player = OMXPlayer('/home/pi/03.mp4', args=['-o','local'])

but it does not work too with some error message. if you don't mind, would you check this one more time please? thank you.

willprice commented 9 years ago

Can you provide the error message please.

On Sun, 20 Sep 2015 16:56 electricgraphy notifications@github.com wrote:

Thanks for your quick reply. I tried again as your replay, like this:

player = OMXPlayer('/home/pi/03.mp4', args=['-o','local']) but it does not work too with some error message. would you check this one more time? thank you.

— Reply to this email directly or view it on GitHub https://github.com/willprice/python-omxplayer-wrapper/issues/34#issuecomment-141799057 .

electricgraphy commented 9 years ago

Hi when I tried one more time with same code today, It works! Thank you very much :D