Possible Duplicate:
Sort by key of dictionary inside a dictionary in Python
I have a dictionary:
d={'abc.py':{'map':'someMap','distance':11},
'x.jpg':{'map':'aMap','distance':2},....}
Now what I need is: I need to sort d
according to their distances?
I tried sorted(d.items(),key=itemgetter(1,2)
, but it's not working.
How can it be done?