(MAC) CoreGraphics module???

David C. Ullrich ullrich at math.okstate.edu
Sat Nov 3 07:51:40 EDT 2007


On Fri, 02 Nov 2007 14:09:25 -0500, Robert Kern
<robert.kern at gmail.com> wrote:

>David C. Ullrich wrote:
>> [...]
>> 
>> So CoreGraphics is a builtin in Apple-Python,
>> explaining why I didn't find the relevant
>> CoreGraphics.py anywhere on the hard drive, eh?
>
>Okay, which version of OS X do you have? In 10.3 and 10.4 it used to be here:
>/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/CoreGraphics.py

I'm using 10.4. Yesterday I checked that there is indeed a

/System/Library/Frameworks/Python.framework

but I didn't look any deeper because I already "knew"
that CoreGraphics.py wasn't there. Come to think of
it, it could well be that it's there and I didn't find
it because Spotlight didn't want to show me things
inside /System? I'll check. (I'll check "soon" -
again, I'm at home and the Mac's at the office.)

>I notice that in 10.5, it no longer exists, though.
>
>> [How do I get to the Python I want?]
>
>Python-Python installed a couple of symlinks into /usr/local/bin and then put
>/usr/local/bin in the front of your $PATH environment variable so it gets picked
>up first on the terminal. For my Python-Python 2.5, I have
>
>  python
>  python2.5
>  pythonw
>  pythonw2.5
>  python-config
>  python2.5-config
>
>Remove these and then when you type "python" at the terminal, you will get
>/usr/bin/python, which points to the Apple-Python.

Thanks. Right this second I have no idea _where_ I should
go to "remove" that, but I can probably find out. It's
in .bashrc or somewhere, I bet, No, don't tell me...
>
>> OR: Is there something special I could do with
>> CoreGraphics scripts and/or how I invoke them
>> so that _they_ would use the Apple-Python while
>> other scripts would just use the Python-Python
>> as now?
>
>For scripts executed from the terminal, you could start them with a hash-bang line:
>
>  #!/usr/bin/python
>
>Use "chmod u+x" on the script, and then you can execute it like any other
>program from the terminal.

Curiously, I did make one of the sample scripts executable and it
still didn't work. I _think_ the hash-bang at the start was
usr/bin/python (I did verify yesterday that /usr/bin/python is
pointing to ApplePython.) Again, don't tell me...

>> [ApplicationLauncher mystery]
>
>I'm afraid I don't. I don't use ApplicationLauncher.

Thanks anyway - this has all been very informatiive.

************************

David C. Ullrich



More information about the Python-list mailing list