(MAC) CoreGraphics module???

Tommy Nordgren tommy.nordgren at comhem.se
Fri Nov 2 13:14:16 CET 2007

On 2 nov 2007, at 02.10, David C. Ullrich wrote:

> Running OS X 10.4 "Tiger". Various references
> by Apple and others say that there exists a
> module that gives Quartz bindings, allowing
> all sort of graphics things in Python.
> Sure enough, after installing Xcode I have
> some sample scripts. They all start with
> from CoreGraphics import *
> (as do all the examples in two books, both
> of which say they're talking about Tiger.)
> I get an ImportError trying to import CoreGraphics.
> I found a CoreGraphics.py in a folder named Carbon;
> when I change the script to read
> import Carbon
> from Carbon.CoreGraphics import *
> there's no import error, but all of the Quartz
> things are NameErrors. I look at CoreGraphics.py,
> it's just about twenty lines long, defining a few
> constants with Quartz-sounding names.
> What gives? I'm supposed to do something else?
> Someone accidentally deleted all the code from
> my CoreGraphics.py? (Is there a working
> CoreGraphics.py around somewhere? I found a
> file somewhere on the net that was the same
> as mine except it ended with
> from CG import *
> Adding that doesn't change anything.)
> (Yes, the XCode installation seems to be working
> fine.)
> ???
> ************************
> David C. Ullrich
> --  
> http://mail.python.org/mailman/listinfo/python-list
	There are Python wrappers for the Cocoa API. These can be used with  
binaries from Python.org.
The name of the module is PyObjC, and can be downloaded from  
There are binary builds for Python up to version 2.4.1.
	For Python 2.5.1, it is necessary to build it yourself, which I've  
found out requires modifying setup.py.
(The problem is that setup.py tries to use two modules that's not  
installed by default on Tiger)
What is a woman that you forsake her, and the hearth fire and the  
home acre,
to go with the old grey Widow Maker.  --Kipling, harp song of the  
Dane women
Tommy Nordgren
tommy.nordgren at comhem.se

More information about the Python-list mailing list