Python 3 and PyObjC
My main programming platform is OS X 10.8 and Python 3 (currently Python 3.3). In earlier blog posts I have discussed installing and using PyCrypto in this environment. My next attempt was to find a GUI solution for this platform. I usually prefer native approaches when programming, and for OS X, the Cocoa framework is the native approach. To get access to this from Python, we need a bridge, and the bridge is called PyObjC. At the home page PyObjC seems like a dead project. But Ronald Oussoren is still doing some development, including Python 3 support. It is not straightforward to compile and install PyObjC for Python 3, but Giacomo Lacava provides the necessary steps. To summarize, I have done the installation using the following steps:
- Fetch the latest code from Ronald Oussoren:
hg clone https://bitbucket.org/ronaldoussoren/pyobjc cd pyobjc
- Compile and install PyObjC core:
(cd pyobjc-core && python3 setup.py install)
- Compile and install the Cocoa, CoreData and Quartz frameworks:
for i in Cocoa Quartz CoreData; do (cd pyobjc-framework-$i && python3 setup.py install) done
- Compile and install the rest of PyObjC (except the XgridFoundation framework):
for i in pyobjc-framework-[^X]*; do (cd $i && python3 setup.py install) done
So far, everything seems to work OK. You need Mercurial (hg) to perform the first step.