Re: Python from Objective-C?
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.