There's http://pypi.python.org/pypi/desktop/0.4, but it seems to be unmaintained.<br>It provides a an "open" command.<br><br>On Sunday, April 22, 2012 10:21:10 PM UTC-7, Hobson Lane wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div>There is significant interest in a cross-platform file-launcher.[1][2][3][4]  <wbr>The ideal implementation would be an operating-system-agnostic interface that launches a file for editing or viewing, similar to the way os.startfile() works for Windows, but generalized to allow caller-specification of view vs. edit preference and support all registered <a href="http://os.name" target="_blank">os.name</a> operating systems, not just 'nt'.</div>

<div><br></div><div>Mercurial has a mature python implementation for cross-platform launching of an editor (either GUI editor or terminal-based editor like vi).[5][6]  The python std lib os.startfile obviously works for Windows.</div>

<div><br></div><div>The Mercurial functionality could be rolled into os.startfile() with additional named parameters for edit or view preference and gui or non-gui preference. Perhaps that would enable backporting belwo Python 3.x. Or is there a better place to incorporate this multi-platform file launching capability?</div>

<div><br></div><div>  [1]: <a href="http://stackoverflow.com/questions/1856792/intelligently-launching-the-default-editor-from-inside-a-python-cli-program" target="_blank">http://stackoverflow.com/<wbr>questions/1856792/<wbr>intelligently-launching-the-<wbr>default-editor-from-inside-a-<wbr>python-cli-program</a></div>

<div>  [2]: <a href="http://stackoverflow.com/questions/434597/open-document-with-default-application-in-python" target="_blank">http://stackoverflow.com/<wbr>questions/434597/open-<wbr>document-with-default-<wbr>application-in-python</a></div>  [3]: <a href="http://stackoverflow.com/questions/1442841/lauch-default-editor-like-webbrowser-module" target="_blank">http://stackoverflow.com/<wbr>questions/1442841/lauch-<wbr>default-editor-like-<wbr>webbrowser-module<br>

</a><div>  [4]: <a href="http://stackoverflow.com/questions/434597/open-document-with-default-application-in-python" target="_blank">http://stackoverflow.com/<wbr>questions/434597/open-<wbr>document-with-default-<wbr>application-in-python</a></div><div>

  [5]: <a href="http://selenic.com/repo/hg-stable/file/2770d03ae49f/mercurial/ui.py" target="_blank">http://selenic.com/repo/hg-<wbr>stable/file/2770d03ae49f/<wbr>mercurial/ui.py</a></div><div>  [6]: <a href="http://selenic.com/repo/hg-stable/file/2770d03ae49f/mercurial/util.py" target="_blank">http://selenic.com/repo/hg-<wbr>stable/file/2770d03ae49f/<wbr>mercurial/util.py</a></div>

</blockquote>