[Pythonmac-SIG] modifying setup.py: py2exe -> py2app

Charles Hartman charles.hartman at conncoll.edu
Wed Feb 2 14:35:46 CET 2005


On Feb 2, 2005, at 1:59 AM, Chris Jerdonek wrote:

> Anyways, I double-clicked the hello icon.  It appeared on the dock and 
> immediately collapsed without any output.  Is this the desired 
> behavior?

Something the program expects isn't available in your Mac's system. 
(There are two different "hello.py" examples. One of them imports an 
Image module. I suppose that *might* be it.) The app gets built all 
right, because the build process has told it OK, you'll find xyz when 
you actually run. Apps built for Tcl act this way when Tcl isn't 
installed on the system. No error message or anything -- except in 
Console, an app most Mac users are not used to consulting.

> This created an executable icon in the Finder called "hello" in a 
> directory called "dist".  Will this always be the stand-alone app?  
> (From the command line hello.app is a directory, which I don't 
> understand.)

I think you're making the same assumption I did until recently: that an 
app and a folder are as essentially different as the Mac OS pretends 
they are. (In Unix, a directory [=folder] is just a special kind of 
file.) But if you Ctrl-click on any app, the contextual menu will 
include an item  called Show Package Contents. That will show a folder 
window just like any other Finder folder window, except that its title 
is the name of the app. It has a folder in it called Contents, and that 
in turn has several files inside it including one called Info.plist (if 
you double-click this a special Mac editor comes up; welcome to the 
wonderful world of XML preference lists, but don't ask *me* for 
directions). The Contents folder also contains folders called MacOS and 
Resources. A lot of things you do with py2app have the effect of 
stuffing one thing or another (an icon file, a data file) into one of 
these. So an app turns out to be a whole village.

Fellow wanderer in benightedness,
Charles Hartman



More information about the Pythonmac-SIG mailing list