Clickable (wx)python app in OS X

Ronald Oussoren ronaldoussoren at
Mon Sep 27 10:45:11 CEST 2004

On 25-sep-04, at 19:35, PhysicsGenius wrote:

> Chris McD wrote:
>> PhysicsGenius wrote:
>>> I have a wxPython program.  It runs fine on OS X when I launch it 
>>> from
>>> the Terminal ("pythonw") .  The user wants to be able to
>>> click it.  Two main suggestions on the Internet, neither of which
>>> works:
>>> 1) "Use Platypus"  So I download it, upgrade Stuffit, install both,
>>> figure out how to use it, create an app....and it doesn't work for
>>> graphical apps.  Nice to know, thanks for telling me ahead of time!
>>> 2) "Just associate .py files with PythonInterpreter".  Sounds easy! 
>>> So I navigate to, Get Info, Open With, navigate to
>>> PythonInterpreter....WhereTF is "PythonInterpreter"?  Not on the OS X
>>> system anywhere and Google only finds a Python module.
>>> So, how do I create a clickable icon that will launch my wxPython
>>> program?
>> Well you are opening it with pythonw so why not associate *.py  with 
>> pythonw or python?
>> Chris
> I was pretty sure this was impossible, but I may have done it.  For 
> anyone else as frustrated as I was (and still am, kinda): I associated 
> .py with 
> /System/Library/Frameworks/Python.framework/Resources/PythonLauncher.  
> It still brings up a Terminal window, but at least the app launches 
> from a click.

If you asked your question on the pythonmac SIG you'd have gotten your 
answer a lot sooner :-)

The best way to build a double-clickeable application on OSX is by 
building an .app bundle that contains your application. One way to do 
this is using bundlebuilder:

    from bundlebuilder import buildapp

	   name = "My Application",
         mainprogram = "",
         resources = ["English.lproj"],
         nibname = "MainMenu",
    # end of

You can now run 'python build' to create the application 
bundle, run 'python' to see some more options.

> Mac OS X: It Just Works (poorly)

No, it works differently :-)

More information about the Python-list mailing list