Tim Chase <[EMAIL PROTECTED]> wrote:
> > assuming that DateTime returns something that compares correctly, you can
> > do something like:
> >
> > def sortkey(item):
> > return item.get("from_datetime")
> >
> > data.sort(key=sortkey)
> >
> > (assuming Python 2.4 or later)
>
> Bu
bruno at modulix wrote:
> Eric Deveaud wrote:
> (snip)
> >
> > sort can take a comparaison function.
>
> The problem with it is that it may slow down things a lot...
point taken.
I have to purge my mind from the other programing languages I practice. ;-)
Eric
--
http://mail.python
Nico Grubert wrote:
> > assuming that DateTime returns something that compares correctly, you can
> > do something like:
> >
> > def sortkey(item):
> > return item.get("from_datetime")
> >
> > data.sort(key=sortkey)
> >
> > (assuming Python 2.4 or later)
>
> Thank you very much, Fr
Eric Deveaud wrote:
(snip)
>
> sort can take a comparaison function.
The problem with it is that it may slow down things a lot...
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/ma
> assuming that DateTime returns something that compares correctly, you can
> do something like:
>
> def sortkey(item):
> return item.get("from_datetime")
>
> data.sort(key=sortkey)
>
> (assuming Python 2.4 or later)
Thank you very much, Frederik. Unfortunately, I can only use P
> assuming that DateTime returns something that compares correctly, you can
> do something like:
>
> def sortkey(item):
> return item.get("from_datetime")
>
> data.sort(key=sortkey)
>
> (assuming Python 2.4 or later)
Building on Fredrik's solution, for 2.3 (or earlier?), you
ca
Nico Grubert wrote:
> Hi there,
>
> I am looking for a way to sort a list containing dictionaries.
>
> This is my example list:
> [{'Title': 'ABC', 'from_datetime': DateTime('2006/04/25 12:45:00
> GMT+2')}, {'Title': 'DEF', 'from_datetime': DateTime('2006/04/18
> 12:45:00 GMT+2')}, {'Titl
Nico Grubert wrote:
> Hi there,
>
> I am looking for a way to sort a list containing dictionaries.
>
> This is my example list:
> [{'Title': 'ABC', 'from_datetime': DateTime('2006/04/25 12:45:00
> GMT+2')}, {'Title': 'DEF', 'from_datetime': DateTime('2006/04/18
> 12:45:00 GMT+2')}, {'Title': 'GHI
Nico Grubert wrote:
> I am looking for a way to sort a list containing dictionaries.
>
> This is my example list:
> [{'Title': 'ABC', 'from_datetime': DateTime('2006/04/25 12:45:00
> GMT+2')}, {'Title': 'DEF', 'from_datetime': DateTime('2006/04/18
> 12:45:00 GMT+2')}, {'Title': 'GHI', 'from_dateti
Hi there,
I am looking for a way to sort a list containing dictionaries.
This is my example list:
[{'Title': 'ABC', 'from_datetime': DateTime('2006/04/25 12:45:00
GMT+2')}, {'Title': 'DEF', 'from_datetime': DateTime('2006/04/18
12:45:00 GMT+2')}, {'Title': 'GHI', 'from_datetime':
DateTime('200
10 matches
Mail list logo