sort a dictionary by key,od = collections.OrderedDict(sorted(d.items()))