json2Object.py

import json
from collections import namedtuple

def json2Object(jsonObj):
return json.loads(jsonObj, object_hook=lambda d: namedtuple('jsonMain', d.keys())(*d.values()))
posted @ 2021-10-05 20:29  石棠  阅读(45)  评论(0编辑  收藏  举报