RE: How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread Prasad, Ramit
san wrote: > > Please let me know how to sort the list of String in either ascending / > descending order without considering > special characters and case. > ex: list1=['test1_two','testOne','testTwo','test_one'] > Applying the list.sort /sorted method results in sorted list ['test1_two', > 'te

Re: How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread MRAB
On 2012-11-27 17:31, san wrote: Please let me know how to sort the list of String in either ascending / descending order without considering special characters and case. ex: list1=['test1_two','testOne','testTwo','test_one'] Applying the list.sort /sorted method results in sorted list ['test1_tw

How to sort list of String without considering Special characters and with case insensitive

2012-11-27 Thread san
Please let me know how to sort the list of String in either ascending / descending order without considering special characters and case. ex: list1=['test1_two','testOne','testTwo','test_one'] Applying the list.sort /sorted method results in sorted list ['test1_two', 'testOne', 'testTwo', 'test_o

Re: How to sort list

2006-11-23 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "Lad" <[EMAIL PROTECTED]> wrote: > I have a list of emails and I would like to sorted that list by domains > E.g. > If the list is > > Emails=['[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL > PROTECTED]',] > > after sorting I would like

Re: How to sort list

2006-11-22 Thread Klaus Alexander Seistrup
Fredrik Lundh wrote: > note that DSU is built into Python these days: > > L.sort(key=transform) Sweet, thanks for the hint. Cheers, -- Klaus Alexander Seistrup http://klaus.seistrup.dk/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to sort list

2006-11-22 Thread Fredrik Lundh
Klaus Alexander Seistrup wrote: > Decorate-sort-undecorate? > > #v+ > > array = [] > > for addr in Emails: > (user, domain) = addr.split('@') > array.append((domain, user, addr)) > # end for > > array.sort() > > SortedEmails = [addr for (user, domain, addr) in array] > > #v- note that D