Access Objective-C classes from Python
Go to file
Gabriel Pettier 4e514a0956 determine pointer type tag value at compile time 2015-03-13 18:41:24 +01:00
docs added varargs docs. updated INCLUDE dict docs 2013-09-22 14:12:08 +02:00
examples Use @protocol to declare delegate implementation. Ensure that class can be used as delegate, if we have at least one @protocol decorated method. (+ support None as nil for id) 2014-02-04 00:45:17 +01:00
objc_classes added release to object inside bridge class 2013-09-04 02:08:18 +02:00
pyobjus determine pointer type tag value at compile time 2015-03-13 18:41:24 +01:00
tests renames for files and dirs. Added objc_aux dir, which will hold classes which are needed to get work some parts of cocoa api with pyobjus. This will usually be some wrapper functions 2013-09-03 14:44:38 +02:00
tools experimental protocols discovery from System frameworks / Headers. 2014-02-04 15:34:03 +01:00
.gitignore enhance setup and Makefile to not force compilation of pyobjus, only use depends changes. 2014-02-06 18:19:35 +01:00
LICENSE Pyobjus is now under MIT license 2013-08-01 16:32:43 +02:00
Makefile enhance setup and Makefile to not force compilation of pyobjus, only use depends changes. 2014-02-06 18:19:35 +01:00
README.md Update README.md 2013-08-07 20:04:54 +02:00
setup.py enhance setup and Makefile to not force compilation of pyobjus, only use depends changes. 2014-02-06 18:19:35 +01:00

README.md

Pyobjus

Python module to access Objective-C class as Python class, using Objective-C runtime reflection.

(Work in progress.)

Quick overview


from pyobjus import autoclass, objc_str
from pyobjus.dylib_manager import load_framework, INCLUDE

# load AppKit framework into pyojbus
load_framework(INCLUDE.AppKit)

# get nsalert class
NSAlert = autoclass('NSAlert')

# create an NSAlert object, and show it.
alert = NSAlert.alloc().init()
alert.setMessageText_(objc_str('Hello world!'))
alert.runModal()