[Pythonmac-SIG] pythonw and python with applescript

Zhi Peng zhiyong_peng2003 at yahoo.com
Wed Dec 14 04:24:02 CET 2005


  If part of all code can be compiled as .so library on Mac and also be imported by python, it will be ideal case. As I tried swig utility, it seems it does not work well on Mac. It does not show the error message. I do not know the reason. The compile and ld linker seems fine. I would like to have a small C code and then compile and linked as dynamic library so that it can be imported by python code as we had in Linux platform. I have not tried it completely. except by swig. 
   
  Mac terminal looks like unix/linux, but there are some difference, which I may not know enough. In C code, all argumnet, parameters have to be changed to in PyObject form, otherwise, python code may not be able to call the function. Not sure if anyone trys swig utility on other platform? on swig home page, there is an example, it might work on linux/unix. But it does not work well on Mac as I tried it. 
   
  Thanks for all info and help. 
   
  Zhi

Bob Ippolito <bob at redivi.com> wrote:


Bob Ippolito <bob at redivi.com> wrote:  
On Dec 13, 2005, at 4:45 PM, Zhi Peng wrote:

> See if I go the right direction.
>
> On Wed, I will use my old code to build .so file which is run on 
> Linux. See what happen.
>
> I used swig and get name.so file and get rid of error message. When 
> I start python or pythonw and import name
> from command line, it just hang there. It is interesting (not show 
> any error). I would rather write a little more code on this part. 
> On Linux, it generate name.so, is it same name style on MAc ? any 
> difference? Thanks Bob and others.
>

Use distutils, it knows how to build extensions on all platforms. If 
you're not using distutils, then you'll almost certainly do something 
incorrectly. Distutils knows better than you which compiler and 
linker options to use for linking extensions.

Yes, the naming convention for Python extensions on Linux and Mac OS 
X happens to be the same. The actual extension binaries are going to 
be very different and totally incompatible though.

-bob




			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20051213/8c18c74d/attachment.htm


More information about the Pythonmac-SIG mailing list