In Python, what is the best way to open a folder in Explorer or its cross-platform equivalent?

Viewed 23

I have a Blender template that I've publicly shared online, and I'm adding a Python script to it to perform a batch render. I'd like it to automatically open the output folder at some point, and my research tells me that os.startfile will do the job, but the problem is that only works on Windows. I want my script to be cross-platform, and have it open in Explorer, Finder, or whatever the default file manager is on the user's computer. I'd also rather not require any external dependencies that aren't available on a stock installation of Blender. How can I do this?

0 Answers
Related