[Pythonmac-SIG] Should Python.app be an LSUIElement = 1 app?

Bill Janssen janssen at parc.com
Tue Feb 3 18:55:56 CET 2009


Ronald Oussoren <ronaldoussoren at mac.com> wrote:

> 
> On 3 Feb, 2009, at 17:54, Bill Janssen wrote:
> >
> >> I'm seriously wondering if having "Python Launcher.app" is a good
> >> idea, and if we shouldn't scrap it entirely. If building full app
> >> bundles using py2app is too much of a burden we could look into
> >> providing an easier and more lightweight way to build such bundles.
> >> The fully standalone bundles that py2app creates are very useful, but
> >> I definitely see the need for very thin .app bundles as well.
> >
> > Interesting idea.  What's the lightest thing that's an app, anyway?
> >
> 
> AFAIK an executable + Info.plist + icon file (plus the right directory
> structure). The executable can be shell-script on Leopard, but a
> simple executable would IMHO be better.  One way to structure such an
> executable is to read the name of the actual script to execute from
> the Info.plist (using a custom key) and then use the standard Python
> C- 
> API to execute that script.

So you'd have a little custom launcher that would read that key and use
the Python C API -- sort of the way that Java apps use the
JavaApplicationStub.  Doesn't actually have to be a C program, you know;
it could be a shell script:

  #!/usr/bin/python
  import plistlib, os
  script = os.path.normpath(plistlib.readPlist('../Info.plist')['ApplicationPythonScript'])
  os.execv(['/usr/bin/python', script])

I didn't test that!

Bill


More information about the Pythonmac-SIG mailing list