(MAC) CoreGraphics module???

David C. Ullrich ullrich at math.okstate.edu
Thu Nov 1 21:10:10 EDT 2007


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



More information about the Python-list mailing list