I know mac users cannot use os.startfile()
but is there any alternative for mac users?
I am just trying to load a file within python but I would like to find a way to do so.
Error:
Module 'os' has no 'startfile' member
I know mac users cannot use os.startfile()
but is there any alternative for mac users?
I am just trying to load a file within python but I would like to find a way to do so.
Error:
Module 'os' has no 'startfile' member
You can try os.system
with open
. For example:
os.system("open Untitled.pdf")
This will open the file Untitled.pdf with the default PDF application ('Preview', in my case).
you should just be able to do:
import subprocess as sp
sp.call(['open', 'application_or_file_name'])