4

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

D.C.
  • 15,340
  • 19
  • 71
  • 102

3 Answers3

6

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.

jscs
  • 63,694
  • 13
  • 151
  • 195
5

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

Chuck
  • 234,037
  • 30
  • 302
  • 389
2

I'm not sure if this particular combination works, but you might be able to use SWIG to create a Python module out of your Objective-C which can then be imported into Python.

Daniel DiPaolo
  • 55,313
  • 14
  • 116
  • 115