def list_test(): list1=[] def list_all_dict(a): #检测字段类型 if isinstance(a,dict): for x in range(len(a)): temp_key=list(a.keys())[x] temp_value=a[temp_key] if isinstance(temp_value,dict): list_all_dict(temp_value) else: list1.append(temp_value) list_all