Re: [Pyobjc-dev] Pure Python Cocoa GUI application?
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2009-03-31 23:23:00
|
On 31 Mar, 2009, at 18:02, Greg Ewing wrote: > Ronald Oussoren wrote: > >> Both should work the same on recent versions of Python (at worst >> starting at 2.6, I haven't check 2.5 but IIRC even there python and >> pythonw are the same executable). > > On further investigation, it seems you're right. I was sure > I had a situation just recently where python wouldn't give > me a dock icon, but I can't seem to reproduce it now. > > The part about it being inside an app bundle doesn't seem > to be right, though, at least for 2.5: We're way more sneaky than that ;-). If you look carefully you'll notice that the pythonw executable is tiny and doesn't actually link with the Python framework. That's because this executable has just one task: exec-ing the executable inside the Python.app application. This is needed to ensure that the C-level argv[0] contains a path that is an absolute path that contains proof that we're inside a .app bundle. We cannot tweak argv[0] inside a running application, Apple's framework fetch the value of argv[0] from some other, hidden and undocumented, location. That's why the executable inside virtualenv environments behaves differently, that executable is the one that is normally inside the "Python.app" bundle. Ronald |