• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Python from Objective-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python from Objective-C?


  • Subject: Re: Python from Objective-C?
  • From: Glenn Andreas <email@hidden>
  • Date: Sat, 10 Jan 2004 18:37:22 -0600

At 6:03 PM -0600 1/10/04, Jonathan Wight wrote:
A better place to ask might be:
http://www.python.org/sigs/pythonmac-sig/

However I've previously called Python from Objective-C before. You do
it just like you would call Python from C or C++. See:
http://www.python.org/doc/current/ext/ext.html - the only thing
different is the way you link to Python - under 10.3 there is a
Python.framework that you might be able to link (not sure because I
linked to Python in the old days before the framework came along) - the
Pythonmac-sig people will be able to help if you have problems.

Yes you can, it "just works". Add /System/Frameworks/Python.frameworks to your frameworks, and /System/Frameworks/Python.frameworks/Headers to your header include search list (so you can just #include "Python.h") and that's it.


Also the O'Reilly Programming Python book by Mark Lutz has an excellent
chapter (or two I forget) on Embedding Python.

I wonder if you can embed Python and then from Python call back into
your application via PyObjC? Will have to play with it and find out.

Absolutely. The python IDE I've been working on does this extensively. The one trick is to be able to export your Objective-C object as a Python object when you are explicitlly calling a routine, etc... (basically, there's a routine in PyObjC you call to do this for your).

--
Glenn Andreas email@hidden Theldrow, Blobbo, Cythera, oh my!
Be good, and you will be lonesome
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Python from Objective-C? (From: Owen Anderson <email@hidden>)
 >Re: Python from Objective-C? (From: Jonathan Wight <email@hidden>)

  • Prev by Date: Re: Python from Objective-C?
  • Next by Date: NSString's stringWithFormat
  • Previous by thread: Re: Python from Objective-C?
  • Next by thread: Detecting a new application launch?
  • Index(es):
    • Date
    • Thread