Installing 2.6 on a Mac

2009-04-24 Thread Greg Reyna
I want to install Python 2.6 on a dual 1.42 GHz MacG4 tower running 
OS 10.5.6.  The Python installer wants to create the Python.framework 
directory in "/Library/Frameworks" but it can't because there's an 
alias of the same name in there.  On this machine, Python 2.5.1 is 
installed in 
"/System/Library/Frameworks/Python.framework/Versions/2.5"


The "Versions" folder has within it folders for "2.3","2.5", and 
"Current" (the latter is an alias to the 2.5 folder)


FYI: In the /System/Library/Frameworks/Python.framework folder are 
aliases to Resources, CodeResorces, and the Python program itself. 
These all point to the 2.5 folder.


So, my question is, can I move the alias out of 
"/Library/Frameworks", let the installer do its thing, then move the 
newly installed files into "/System/Library/Frameworks/" so 
everything will be together?  Naturally, I would follow the odd way 
everything is currently installed by creating a 2.6 directory.  After 
that, I will exchange all the aliases so they point at the new 2.6 
directory, as well as creating a new alias for "/Library/Frameworks".


I'm new at this so I wanted to check with someone who knows what 
they're doing.  I always heard we're not supposed to mess with the 
System/Library, but I guess this is an exception.


Thanks for any help,
Greg Reyna
--
http://mail.python.org/mailman/listinfo/python-list


Procedures

2009-06-22 Thread Greg Reyna
Learning Python (on a Mac), with the massive help of Mark Lutz's 
excellent book, "Learning Python".


What I want to do is this:
I've got a Class Object that begins with a def.  It's designed to be 
fed a string that looks like this:


"scene 1, pnl 1, 3+8, pnl 2, 1+12, pnl 3, 12, pnl 4, 2+4,"

I'm parsing the string by finding the commas, and pulling out the 
data between them.
No problem so far (I think...)  The trouble is, there is a place 
where code is repeated:


1. Resetting the start & end position and finding the next comma in the string.

In my previous experience (with a non-OOP language), I could create a 
'procedure', which was a separate function.  With a call like: 
var=CallProcedure(arg1,arg2) the flow control would go to the 
procedure, run, then Return back to the main function.


In Python, when I create a second def in the same file as the first 
it receives a "undefined" error.  I can't figure out how to deal with 
this.  How do I set it up to have my function #1 call my function #2, 
and return?


The only programming experience I've had where I pretty much knew 
what I was doing was with ARexx on the Amiga, a language much like 
Python without the OOP part.  ARexx had a single-step debugger as 
part of the language installation.  I've always depended on a 
debugger to help me understand what I'm doing (eg Script Debugger for 
Apple Script--not that I understand Apple Script)  Python's debug 
system is largely confusing to me, but of course I'll keep at it.  I 
would love to see a step-by-step debugging tutorial designed for 
someone like me who usually wants to single-step through an entire 
script.


Thanks for any help,
Greg Reyna

--
http://mail.python.org/mailman/listinfo/python-list