[Pythonmac-SIG] Application without py2app?

Thorsten Kohnhorst monsterkodi at gmx.net
Tue May 16 01:36:27 CEST 2006


Hello Ronald,

you made my day :-)

>> No, I am fine using an application bundle.
>> It's just that the IDE I am trying to use (SPE) seems to know  
>> nothing about executables.
>> And I guess that the included debugger might only work if the  
>> application is started from a python script.
>>
>> If there was another way to use a python IDE with a debugger I  
>> won't care about how exactly the app is started.
>>
>> I hope I made myself clearer now.
>> Thanks again for your fast reply.
>
> The best solution would be to teach SPE about application bundles,  
> but I don't know how hard that would be.
>
> Bundle support in Cocoa/CoreFoundation uses the C-level argv[0] (*)  
> to calculate the default location for bundles. Bundlebuilder  
> (py2app's predecessor(sp?)) uses a copy of the python interpreter  
> inside the directory Foo.app/Contents/MacOS to run the user's  
> application. The bundle application (Foo.app/Conents/MacOS/Foo) is  
> a python script that sets up the right environment and then calls  
> the embedded python interpreter. You could try to use something  
> like that to run your application from SPE.
> (*) Technically it doesn't even use that, but the first argument to  
> the execv that was used to start the application.

This was exactly the information I was looking for.
After some hours of trial and error I have a perfect working  
environment now.
I used the Bundlebuilder script to set up a working application  
bundle based on a python executable.
Then I decided to drop SPE and installed the latest Eclipse with  
PyDev instead.
The tricky part was to get Eclipse to use the Python executable  
inside the bundle for debugging and launching.
But I found out that this could easily be done with a symlink.
Now I can set a breakpoint anywhere and step through my code with a  
decent IDE.
Very nice.

Thanks a lot for your help.

Yours kodi















More information about the Pythonmac-SIG mailing list