[Pythonmac-SIG] building extensions for 2.3 (darwin build), and UUID generation

Bob Ippolito bob at redivi.com
Wed Dec 31 13:22:47 EST 2003


On Dec 31, 2003, at 1:02 PM, Paul Miller wrote:

>
>>> Interesting, but a rather big way of implementing this. I just need 
>>> 2 function calls from the UUID API. I'll keep trying to get my own 
>>> extension module buildling.
>>
>> "rather big"?  You need to learn the principle of least time wasted ;)
>> Besides, the framework is 40k tarballed and 284k uncompressed.
>
> I was looking at the full download size, but my situation is more 
> complicated than that. This is software being developed for another 
> company, so then it becomes an issue of where to install the framework 
> and how to give credit in documentation I have no control over. Also, 
> add on the time it takes me to learn how to use the Mac Python ObjC 
> interfaces to actually USE the API, and we're straddling a fine line 
> between a bunch of wasted time no matter which way you look at it.

The framework can go wherever you want.. including inside of a python 
package, which is how I normally do it (using __file__ from __init__.py 
to determine the base location).  You just need to know the absolute 
path of the framework.  Besides, I showed you how to use the 
interfaces, it takes three lines of code to load PyObjC and the 
framework then get a uuid string out of it ;)

> Since I already have a working code and suitable module init code, it 
> FEELS like getting my module working would be slightly easier. 
> Obviously, it is not turning out that way!

Of course not, because you're trying to setup a complicated compilation 
and linking procedure from a GUI tool without a template.  Make a 
"setup.py" using distutils to build it.  I have never heard of anyone 
compiling a Mach-O python bundle with CodeWarrior either.  I'm sure 
it's possible, but everyone I know uses GCC, typically via distutils 
but sometimes with a Makefile or Xcode / PB.

You could alternatively write your own ObjC framework and load it in as 
I demonstrated, which saves you from learning distutils if you already 
know your way around Xcode and ObjC.

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20031231/e02dc5d6/smime-0001.bin


More information about the Pythonmac-SIG mailing list