<p>I want to open a folder window, in the appropriate file manager, from within a cross-platform (windows/mac/linux) Python application.</p>

<p>On OSX, I can open a window in the finder with</p>

<pre><code>os.system('open "%s"' % foldername)
</code></pre>

<p>and on Windows with</p>

<pre><code>os.startfile(foldername)
</code></pre>

<p>What about unix/linux? Is there a standard way to do this or do I have to special case gnome/kde/etc and manually run the appropriate application (nautilus/konqueror/etc)?</p>

<p>This looks like something that could be specified by the <a href="http://freedesktop.org" rel="noreferrer">freedesktop.org</a> folks (a python module, similar to <code>webbrowser</code>, would also be nice!).</p>

[{'answer_id': 41999, 'author': 'Tanj', 'author_id': 4275, 'author_profile': 'https://Stackoverflow.com/users/4275', 'pm_score': 0, 'selected': False, 'text': "<p>this would probably have to be done manually, or have as a config item since there are many file managers that users may want to use. Providing a way for command options as well.</p>\n\n<p>There might be an function that launches the defaults for kde or gnome in their respective toolkits but I haven't had reason to look for them.</p>\n"}, {'answer_id': 42039, 'author': 'Adam Lassek', 'author_id': 1249, 'author_profile': 'https://Stackoverflow.com/users/1249', 'pm_score': 0, 'selected': False, 'text': "<p>You're going to have to do this based on the running window manager. OSX and Windows have a (defacto) standard way because there is only one choice.</p>\n\n<p>You shouldn't need to specify the exact filemanager application, though, this should be possible to do through the wm. I know Gnome does, and it's important to do this in KDE since there are two possible file managers (Konqueror/Dolphin) that may be in use.</p>\n\n<p>I agree that this would be a good thing for freedesktop.org to standardize, although I doubt it will happen unless someone steps up and volunteers to do it.</p>\n\n<hr>\n\n<p>EDIT: I wasn't aware of xdg-open. Good to know!</p>\n"}, {'answer_id': 42046, 'author': 'pixelbeat', 'author_id': 4421, 'author_profile': 'https://Stackoverflow.com/users/4421', 'pm_score': 5, 'selected': True, 'text': '<pre><code>os.system(\'xdg-open "%s"\' % foldername)\n</code></pre>\n\n<p><code>xdg-open</code> can be used for files/urls also</p>\n'}]
['https://Stackoverflow.com/questions/41969', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3002/']