Created
December 20, 2013 01:17
-
-
Save efrenfuentes/8049016 to your computer and use it in GitHub Desktop.
OrderedDict on Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple version for Python 2.7+ | |
my_ordered_dict = json.loads(json_str, object_pairs_hook=collections.OrderedDict) | |
# Or for Python 2.4 to 2.6 | |
import ordereddict | |
my_ordered_dict = json.loads(json_str, object_pairs_hook=ordereddict.OrderedDict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment