I have a dictionary. The keys are dates (datetime). I need to sort the dictionary so that the values in the dictionary are sorted by date - so that by iterating through the
I'm sure that python knows how to compare dates. So:
def sortedDictValues(adict): items = adict.items() items.sort() return [value for key, value in items]