Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>By double-clicking a <code>.py</code> file on OS X, you are likely launching a Python gui instance via the <code>Python Launcher.app</code> supplied with OS X Pythons. You can verify that by selecting the <code>.py</code> file in the Finder and doing a <code>Get Info</code> on it. Python Launcher is a very simple-minded app that starts Python via a Terminal.app command. To directly launch your own Python GUI app, the preferred approach is to create a simple app using <a href="http://pypi.python.org/pypi/py2app/" rel="nofollow noreferrer">py2app</a>. There's a brief tutorial <a href="http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#tutorial" rel="nofollow noreferrer">here</a>.</p> <p>EDIT:</p> <p>There are other ways, of course, but most likely any of them would be adding more levels of indirection. To make a normal launchable, "double-clickable" application, you need some sort of app structure. That's what <code>py2app</code> lets you create directly.</p> <p>A very simple-minded alternative is to take advantage of the AppleScript Editor's ability to create a launcher app. In the <code>AppleScript</code> editor:</p> <ul> <li><p><code>/Applications/Utilities/AppleScript Editor.app</code> in OS X 10.6</p></li> <li><p><code>/Applications/AppleScript/Script Editor.app</code> in 10.5</p></li> </ul> <p>make a new script similar to this:</p> <pre><code>do shell script "/path/to/python /path/to/script.py &amp;&gt; /dev/null &amp;" </code></pre> <p>and then <code>Save As..</code> with <code>File Format -&gt; Application</code>. Then you'll have a double-clickable app that will launch another app. You can create something similar with Apple's <code>Automater.app</code>. But, under the covers, they are doing something similar to what <code>py2app</code> does for you, just with more layers on top.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload