Hi, Well, I'm beat. I can't wrap my head around this stuff. I need to create a list that will contain objects sorted by a "name" property that is in the alphabetical order of the user's locale.
I used to have a simple list that I got from os.listdir and I could do this: l = os.listdir(".") l.sort(locale.strcoll) Which would work fine. But now I need to make objects (of different stripes) for each of the filenames returned and then I want to collect them all into a main list and have *that* main list be sorted. I started some test code like this: I hope the odd characters show. # -*- coding: utf8 -*- class Test(object): def __init__(self,nam): self.name = nam def __cmp__(self, other): return cmp(self.name, other.name) l = [ Test("ABILENE.ttf"), Test("Årgate.ttf"), Test("årse.ttf"), Test("Ärt.ttf"), Test("MomentGothic.ttf"), Test("öggi.ttf"), Test("Öhmygawd.ttf")] import locale l.sort() # won't work -> locale.strcoll) for i in l: print i.name Can anyone give me a leg-up? \d -- http://mail.python.org/mailman/listinfo/python-list