Trying to run this program, I got this error:
Traceback (most recent call last):
File "piltk.py", line 84, in <module>
os.startfile(filename)
AttributeError: 'module' object has no attribute 'startfile'
How to fix this ?
Trying to run this program, I got this error:
Traceback (most recent call last):
File "piltk.py", line 84, in <module>
os.startfile(filename)
AttributeError: 'module' object has no attribute 'startfile'
How to fix this ?
On Linux you can use:
import subprocess, sys
opener = "open" if sys.platform == "darwin" else "xdg-open"
subprocess.call([opener, filename])
Adopted from here
Given that you are not running on Windows you cannot use os.startfile
. If you want to launch another process you could use os.system
or look at the subprocess
module