> How about sorting the strings as they are reversed? > > urls = """\ > http://mail.google.com > http://reader.google.com > http://mail.yahoo.co.uk > http://google.com > http://mail.yahoo.com""".split("\n") > > sortedList = [ su[1] for su in sorted([ (u[::-1],u) for u in urls ]) ] > > for url in sortedList: > print url > <snip> > > Close to what you are looking for, might be good enough?
Great... I couldn't thought that way. Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list