[Baypiggies] Newbie: Python on Mac

Ned Deily nad at acm.org
Tue Mar 1 08:05:53 CET 2011

In article 
<AANLkTimArY+0h5bex_5pEnxrerGmAnt1v4baUV3At8bA at mail.gmail.com>,
 Tony Cappellini <tony at tcapp.com> wrote:
> I want to be able to launch gui programs that end in .pyw,
> instead of opening the source file in Idle.
> How do I de-associate .py & .pyw files so they execute in a console or a gui
> (respectively),
> by double-clicking on them in Finder?
> Running a .pyw file from a bash prompt launches the gui just fine, so I
> just need to be able change the way the double-click works.

On OS X, .pyw is not normally used as an extension for Python files.  
There is actually no difference between python and pythonw on OS X.   
That said, the simplest way to change the application association for a 
file extension on OS X is to select (single-click) on the file in the 
Finder, then select Get Info (from the Finder File menu or type CMD I).  
In the Info window that opens, if necessary, click on the disclosure 
triangle next to "Open with" and then select the application you want to 
use.  Most likely the choices will be several versions of IDLE and 
possible several versions of Python Laucher (a simple launcher app 
included with the python.org distributions).  If you always want to use 
that app for all files with that extension, click the "Change All..." 
button as well.

 Ned Deily,
 nad at acm.org

More information about the Baypiggies mailing list