Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap Objective-C, to be called from Python?

I have created an objective-C framework that I would like to import and access through a python script. I understand how to import this stuff in Python, but what do i need to do on the obj-c side to make that framework importable?

Thanks

like image 861
D.C. Avatar asked Dec 12 '22 14:12

D.C.


2 Answers

You'll want to use PyObjC, as Chuck said. Specifically, I'd suggest getting the source, which contains a collection of scripts, pyobjc-metadata (here's the readme), that doesn't seem to be included in the default Apple installation, for wrapping a framework, generating the metadata the Python side needs, and so forth.

like image 149
jscs Avatar answered Dec 28 '22 22:12

jscs


You can just use PyObjC, which is included in Mac OS X 10.5 and later.

like image 44
Chuck Avatar answered Dec 28 '22 22:12

Chuck