I have 2 dictionaries, dict1 and dict2 which contain the same keys, but different values for the keys. What I want to do is for each dictionary, s
dict1
dict2
What version of python are you using? If 2.7, use OrderedDict.
Per the Python 2.7 docs:
OrderedDict(sorted(d.items(), key=d.get))
If you're using Python 2.4-2.6 you can still use OrderedDict by installing it from pypi here or if you have setuptools, run
easy_install ordereddict