I am new to Linux but not Python. I am trying to migrate my Python skills to Linux. With Windows I can open an image file with the default viewer using.
import os
os.system(r"C:\gTemp\Capture.JPG")
Using a valid Linux path the same code returns 'Permission denied'
import os
os.system(/home/myname/Capture.JPG")
Why am I getting this error and how do I fix it? I am using 16.04 with Python 2.7
system("xdg-open /home/myname/Capture.JPG")
- or (probably better) usesubprocess.call
as described here: How to open a file with the standard application? – steeldriver Oct 18 '17 at 22:51