python字典转对象

class DictToStruct:
    def __init__(self, **entries):
        self.__dict__.update(entries)
struct = DictToStruct(**temp)

分享文章:python字典转对象
标题来源:http://scyanting.com/article/ppiico.html