Python Xdg-open()
Trying to use xdg-open in a python script xdg-open test.mp4 but get the following error: File 'dl.py', line 21 xdg-open test.mp4 ^ SyntaxError: invalid syntax
Solution 1:
I don't have enough reputation for a comment, but since no one else is replying I try to give an answer. I don't remember about 2.7 but in Python 3 I normally use something like this:
os.system("xdg-open "+ <string>)
os.system is a command also in Python 2.7. You have to import os first. Hope it helps ;-)
Post a Comment for "Python Xdg-open()"