Excellent, the thing works!
Thanx a lot!
- Original Message -
From: Kent Johnson
To: Igor Mavrović - ma...@irb
Cc: Rich Lovely ; tutor@python.org
Sent: Wednesday, September 16, 2009 7:06 PM
Subject: Re: [Tutor] Fw: utf locale sorting
How about this (assuming both
On Wed, Sep 16, 2009 at 11:45 AM, Igor Mavrović - ma...@irb
wrote:
> Sorry Kent, I should have put it in the original message...
> This is the way I call the sorted function:
>
> # resultSet looks like: [[("DN", {"":["", ...], ...})], ...]
>
> resultSetSortedByCn = sorted(resultSet, key=lambda
rted(words, key=lambda o: locale.strxfrm(o[0]))
can't work 'cause strxfrm's argument must be a string, not a tuple...
What do you think?
Igor
- Original Message -
From: Rich Lovely
To: Igor Mavrović - ma...@irb
Cc: tutor@python.org
Sent: Wednesday, September 16, 2009 4
2009/9/16 Igor Mavrović - ma...@irb :
> Hi,
>
> I know about the use of locale module:
>
import locale
locale.setlocale(locale.LC_ALL, "hr_HR.UTF8")
print sorted(words, key=locale.strxfrm)
>
> but I have specific and complicated data structure (list of lists containing
> strings, tup
On Wed, Sep 16, 2009 at 9:51 AM, Igor Mavrović - ma...@irb
wrote:
> Hi,
>
> I know about the use of locale module:
>
import locale
locale.setlocale(locale.LC_ALL, "hr_HR.UTF8")
print sorted(words, key=locale.strxfrm)
>
> but I have specific and complicated data structure (list of li
Hi,
I know about the use of locale module:
import locale
locale.setlocale(locale.LC_ALL, "hr_HR.UTF8")
print sorted(words, key=locale.strxfrm)
but I have specific and complicated data structure (list of lists containing
strings, tuples and dictionaries) due to LDAP search result data.
So I u