Sorting a Python list by third element, then by first element, etc?
Question: Say I have a list in the form [[x,y,z], [x,y,z] etc...] etc where each
grouping represents a random point.

I want to order my points by the z coordinate, then within each grouping of
z's, sort them by x coordinate. Is this possible?


Answer: Sure, look at [this page](http://wiki.python.org/moin/HowTo/Sorting) under the
section called "Operator Module Functions." Basically you just need to use
sort's key feature with the itemgetter operator...

    
    
    from operator import itemgetter
    sorted(tuples, key=itemgetter(2,0))
    

