Re: [Pyobjc-dev] Detecting Python interpreters on startup
Brought to you by:
ronaldoussoren
From: Dinu G. <gh...@da...> - 2003-09-05 15:51:12
|
Just van Rossum: > When he wrote """When I tried to run it on my Mac (10.2.6) by > double-clickign the application, it started and then closed without any > screen coming up""" I immediately thought: his /usr/bin/python is > broken > or gone. We'll never know for sure until we see what's in his > Console.app. That's (at least partly) entirely my fault, so let's ignore that... > For end user apps, the best thing to do is INCLUDE the Python you're > testing and building with with your app bundle. Luckily bundlebuilder > makes this very easy. Use --standalone, with --strip to reduce the size > of the bundle. Using Python 2.3 enables zipimport, making your .app > smaller yet. I built a tiny standalone PyObjC app today, and compressed > with StuffIt it's a 1 meg download. This includes a (stripped down > version of) Python.framework. "python2.3 buildapp.py --standalone > --strip build" was all there was to it. Yes, that's probably the best thing to do. I sniffed more into bundlebuilder now. On 2.3 it seems to use a modulefinder, ok... I wasn't quite aware how cool it is! But... when creating two vanilla PB projects from the PyCocoaApp and PyCocoaDocApp templates and adjusting the buildapp.py script as below (run with python buildapp.py --standalone --strip build) I get a working app only for the single document version. The multi- document version launches, but never shows any window. Any idea? What's the role of the myseterious Main.py files in some of the sample projects? Thanks, Dinu PS: I think "#! /usr/bin/env python" should be really preferred over "#! /usr/local/bin/python"... #! /usr/bin/env python import os from bundlebuilder import buildapp src = [ fn for fn in os.listdir('.') if fn.endswith('.py') and fn not in ('buildapp.py',) ] buildapp( name = "TestTest2", mainprogram = "__main__.py", resources = ["English.lproj"] + src, nibname = "MainMenu", ) |