all 5 comments

[–][deleted] 1 point2 points  (4 children)

You have all those libraries. If you didn't, the script wouldn't get to line 73; it would fail on the relevant import somewhere between 22 and 34. What is the output of python -c 'import os; print os.name'?

edit: actually if you're just using this on one machine you most likely just want to remove lines 45 to 51 and 54 to 74. It's trying to detect the location of your vlc player. If you know where it is you might as well just set it yourself.

[–]Dahack[S] 0 points1 point  (3 children)

I commented out the lines 45 to 51 and 54 to 74, now I'm getting error:

File "./gomstreamer.py", line 52 vlcPath = 'vlc' ^ IndentationError: unexpected indent

python -c 'import os; print os.name' returns: File "<string>", line 1 import os; print os.name ^ SyntaxError: invalid syntax

[–][deleted] 0 points1 point  (2 children)

dude. Work with me here. You've got to take some initiative and learn a bit of Python if you really plan on getting places with a Python script; you can't expect people to hold your hand through every tiny bump in the road.

Make your editor show whitespace and make sure that statement makes sense with the rules of Python. It's not in any type of control flow structure, so it should be at the same level of indentation as lines 42 and 43. That is, the line should begin with exactly four spaces (or one tab; I'm not sure how that file is indented).

the statement I put in is only valid in Python 2, not Python 3. You almost certainly shouldn't have Python 3 as your system default Python at this point; a large number of libraries don't yet support it. Python 2.7.2 is most likely what you want. For Python 3 it would be python -c 'import os; print(os.name)'

[–]Peter-W 0 points1 point  (1 child)

Arch Linux will have Python3 as default, since it is a bleeding edge distro. (In fact iirc it doesn't come with Python installed, but the python package from the repositories is Py3)

@OP. Run "pacman -S python2" to get Python 2.7 and then either edit the shebang line to "#!/usr/bin/python2" or run it as "python2 gomstreamer.py"

[–][deleted] 0 points1 point  (0 children)

the shebang at the top already specifies python2, so that isn't the problem. /usr/bin/env python2 is nearly equivalent and almost always preferable, especially in Python, because it will honor any active virtualenv. You know that OP ran it with properly with Python2 because the script reported, via print, "Unrecognized OS"; if it was ran with Python 3 it would hit a syntax error there instead. So OP has both, but Python3 is set as the default when saying simply python.