wasm-demo/demo/ermis-f/python_m/cur/0035

36 lines
783 B
Plaintext

From: holger at phoenix-edv.netzservice.de (Holger Jannsen)
Date: Thu, 22 Apr 1999 13:48:58 GMT
Subject: sort of multiple dictonaries
Message-ID: <371F28CA.2240BB7B@phoenix-edv.netzservice.de>
X-UID: 35
Hi there,
perhaps a typical newbie-question:
I've got a list of dictonaries like that:
mydics=[{'sortit': 'no412', 'mode': 'nothing'},
{'sortit': 'no112', 'mode': 'something'},
{'sortit': 'no02', 'mode': 'something else'}]
Is there an easy way to get that list sorted like that:
def sortDictonary(aDictonary, theSortKey="sortit"):
....
Result have to be:
mydics=[{'sortit': 'no02', 'mode': 'something else'},
{'sortit': 'no112', 'mode': 'something'},
{'sortit': 'no412', 'mode': 'nothing'}]
Any hints?
Ciao,
Holger