[Pythonmac-SIG] New to Python - how to get Py2App to work?

altern altern2 at gmail.com
Wed Jul 30 08:58:39 CEST 2008


Chris Mills(e)k dio:
> Greetings,
> 
> I am new to Python, have never developed tools with C++ (I have 
> extensive MEL scripting experience with Autodesk's Maya), and am faced 
> with needing to develop tools to deploy into a Mac OSX 10.5 environment.
> 
> I've downloaded and installed py2app with ez-install and now am faced 
> with getting it to work.
> 
> I have a simple python script which runs from inside the IDE and does 
> what it is supposed to do, but I can not figure out how to get py2app to 
> work. I've seen a number of setup.py references about, but what I would 
> really like is a step by step procedure for getting a simple "hello 
> world" app to be built so that I can have some contextual reference and 
> from there I can probably iterate my way to a successful solution.
> 
> Is there a basic guide out there? The docs on:
> http://undefined.org/python/py2app.html
> do not make sense to me.

I would try to use the Python built in help system by running this on 
the terminal
$ python setup.py py2app --help
that should give you a description of all available options in py2app.
This example below explores some basic ideas, i hope it is not too old. 
I have not used mac so much for the last year or so.

############
#!/usr/bin/env python
from distutils.core import setup
import py2app

py2app_options = dict(
     argv_emulation = True,
     iconfile = 'pathtomyicon.icns',
     packages = ['anyextrapackageshere', 'pyglet', 'twister'],
     resources = [("stuff", ["stuff/file.txt", "stuff/file2.wav"])]
     # there are few more options here i never had to use
)

setup(
     app=['MyApplication.py'],
     options=dict(
         py2app=py2app_options,
     )
)
#############

this is an example with some of the options you will find with the 
python console help above. The "resources" option allows to specify 
files and folders that have to included in the standalone.

Anyway there must be some better documentation. Ah here it is something
http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html

good luck!

enrike

> Thanking you in advance for your patience and guidance.
> 
> Kind regards,
> Chris Mills
> 
> Lizard Lounge Graphics, LTD.
> Wellington, NZ
> http://lizardlounge.com
> 
> Int'l:  +644-977-5400 / +642-174-8770
> NZ local: 04-977-5400 /   021-748-770
> 
> 



More information about the Pythonmac-SIG mailing list