PyObjC and Cocoa
by Dirk Stoop
A short recap: PyObjC is a language bridge between the Objective-C runtime and Python. It allows you to create – and share data with – Objective-C objects from Python code. Even better, it lets you subclass Objective-C classes in Python.
Last night I gave a short presentation on Cocoa development using Python at the CocoaHeads meeting in the San Francisco Apple Store. First of all I'd like to thank Scott Stevenson for putting the event together and inviting me to speak there. It was great to share the stage with a bunch of developers who I respect a lot. And of course thanks to everyone who showed up to listen.
At the end of my talk I said there would be a blog post here with more information about PyObjC and a copy of my slides, this is it.
A short recap: PyObjC is a language bridge between the Objective-C runtime and Python. It allows you to create
– and share data with – Objective-C objects from Python code. Even better, it lets you subclass Objective-C classes in Python, basically allowing you to do anything Cocoa-related in Python that you would normally only be able to do using Objective-C.
PyObjC is pre-installed on Leopard and now uses Apple's BridgeSupport technology. This means that on Leopard, you can use PyObjC with almost all of Apple's Frameworks out of the box. Additionally, when you want to ship a Leopard app that uses PyObjC, you don't have to include an entire Python distribution anymore. On Tiger you had to due to issues with the Python build included with the OS.
We initially developed Checkout for Tiger when PyObjC wasn't supported by Apple yet. There's a pretty neat article on ADC about that experience.
To learn more about PyObjC, there's an entire section of Apple's online documentation that's dedicated to Ruby and Python programming topics.
You can also find development news and sample code on the PyObjC project website.
Finally, if you have access to last year's WWDC movies in ADC on iTunes, I highly recommend Bill Bumgarner's talk on the topic: Session 140 - Developing Cocoa Applications with Python and Ruby.