[Pythonmac-SIG] How to build a double-clickable application

John P Speno speno at isc.upenn.edu
Fri Jan 16 15:57:30 EST 2004


On Fri, Jan 16, 2004 at 11:03:53AM -0800, Russell E. Owen wrote:
> Can anyone point me to documentation on how to build a double-clickable 
> application from a Python package?
> 

This can be very easy to build using bundlebuilder.py.

First create your app building script like so:

### makeapplication.py
from bundlebuilder import buildapp

buildapp(
    name='ApplicationName.app', # what to build 
    mainprogram='main.py',      # your app's main()
    argv_emulation=1,           # drag&dropped filenames show up in sys.argv
    iconfile='myapp.icns',      # file containing your app's icons
    standalone=1,               # make this app self contained.
    includeModules=[],          # list of additional Modules to force in
    includePackages=[],         # list of additional Packages to force in
)

### end of makeapplication.py

Then do this:

% python makeapplication.py build

Which should create a build/ApplicationName.app bundle, which make even
work, but probably needs a little help. There will most likely be a few
warnings, which can probably be safely ignored. There may be additional
modules and libraries to include that buildapp couldn't determine.

For example, you may need to copy Tcl.Framework and Tk.Framework into
build/ApplicationName.app/Contents/Frameworks. I use those from the
standalone Aqua Tcl/TK package (i.e. the Wish.app/Contents/Frameworks/*).

Maybe this could get added to the wiki. I'll do that if folks think so.

Hope that helps.

-- 
Speno's Pythonic Avocado
http://www.pycs.net/users/0000231



More information about the Pythonmac-SIG mailing list