[Pythonmac-SIG] Python shared libraries

Jack Jansen Jack.Jansen at cwi.nl
Sat Sep 13 15:40:42 EDT 2003


On 10-sep-03, at 19:46, Bob Ippolito wrote:
> If you REALLY need to use NSCreateImageFromFile you can use 
> /Libraries/Frameworks/Python.framework/Versions/Current/Python as the 
> image, it's just about the same thing as the libpython2.3.dylib you 
> would get otherwise (which I mentioned before, and is in Apple's 
> documentation).

I think you should try this suggestion by Bob. But I'm not convinced 
that it will work,
because the initialization code expects to be run from a framework (it 
gets the
pathname to the framework it was loaded from, and uses that to 
initialize sys.prefix
and from that sys.path and such). If you're directly loading the shared 
library from
within the framework I can imagine one of three things happening:
1. Everything just works, because this happens to also be how 
frameworks are
    loaded, under the hood:-)
2. The get-framework-pathname code fails, but as the framework is in 
the default
    location this doesn't matter, and sys.prefix and sys.path get 
initialized
    correctly anyway.
3. Python bails out early with an error message.

I'd put my money on (2), but I wouldn't put all that much money on it. 
Please
let us know the results!
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Pythonmac-SIG mailing list