How do I know what program 'xdg-open' will use to open a directory? (Python)

836 Views Asked by At

So I have this:

def openSegmentDirectory(self):
    if platform.system() == "Windows":
        os.startfile(self.segmentPath)
    elif platform.system() == "Linux":
        subprocess.Popen(['xdg-open', self.segmentPath])
    else:
        #for mac
        os.system('open "%s"' % self.segmentPath)

But when using it on linux, the system attempts to open the directory in firefox, which I don't want. How can I change this?

0

There are 0 best solutions below