Can I get JSON to load into an OrderedDict?

前端 未结 6 1015
别跟我提以往
别跟我提以往 2020-11-22 01:13

Ok so I can use an OrderedDict in json.dump. That is, an OrderedDict can be used as an input to JSON.

But can it be used as an output? If so how? In my

6条回答
  •  轮回少年
    2020-11-22 01:50

    You could always write out the list of keys in addition to dumping the dict, and then reconstruct the OrderedDict by iterating through the list?

提交回复
热议问题