View Single Post
Old Apr 6th, 2006, 12:36 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
The sort method in lists allows you to specify a comparison function:
buildinList.sort(lambda a, b : cmp(a.lower(), b.lower()))
Or:
def icmp(a, b):
    return cmp(a.lower(), b.lower())
buildinList.sort(icmp)
Arevos is offline   Reply With Quote