new_d = {} for key in d:  if "." not in key:   new_d[key] = d[key]  else:   lst = key.split(".")   l = len(lst)   now_d = new_d   for i in range(l-1):    try:     now_d[lst[i]]     except:     now_d[lst[i]] = {}    now_d = now_d[lst[i]]    now_d[lst[-1]] = d[key]
点赞 评论

相关推荐

秋盈丶:后续:我在宿舍群里和大学同学分享了这事儿,我好兄弟气不过把他挂到某脉上了,10w+阅读量几百条评论,直接干成精品贴子,爽
点赞 评论 收藏
分享
牛客网
牛客企业服务