(self, result, path=None)
遍历dict，返回字典的值的路径和值组成的list

        :param result: 字典
        :param path: 递归使用，部分路径的值
遍历dict，返回字典的值的路径和值组成的list
遍历dict，返回字典的值的路径和值组成的list
def get_dict_keys_path(self, result, path=None):
        """  遍历dict，返回字典的值的路径和值组成的list

        :param result: 字典
        :param path: 递归使用，部分路径的值
        """
        for k, v in result.items():
            if isinstance(v, list) and v:  # and v  主要是v有可能为空list
                for num, a1 in enumerate(v):
                    if path:
                        self.get_dict_keys_path(a1, "{},{},{}".format(path, k, num))
                    else:
                        self.get_dict_keys_path(a1, "{},{}".format(k, num))
            elif isinstance(v, dict) and v:  # and v  主要是v有可能为dict
                if path:
                    self.get_dict_keys_path(v, "{},{}".format(path, k, ))
                else:
                    self.get_dict_keys_path(v, k)
            else:
                if path:
                    if not v:  # 当v为Fasle时，把它赋值None，已方便删除该key
                        v = None
                    _t = "{},{},{}".format(path, k, v)
                    t2 = _t.split(',')
                    for n, value in enumerate(t2):  # 遍历t2,转换里面为存数字的str为int
                        try:
                            t2[n] = int(value)
                        except:
                            pass
                    self.d_list.append(t2)
                else:
                    self.d_list.append([k, v])
def get_dict_keys_path ( self , result , path = None ) : for k , v in result . items ( ) : if isinstance ( v , list ) and v : # and v  主要是v有可能为空list for num , a1 in enumerate ( v ) : if path : self . get_dict_keys_path ( a1 , "{},{},{}" . format ( path , k , num ) ) else : self . get_dict_keys_path ( a1 , "{},{}" . format ( k , num ) ) elif isinstance ( v , dict ) and v : # and v  主要是v有可能为dict if path : self . get_dict_keys_path ( v , "{},{}" . format ( path , k , ) ) else : self . get_dict_keys_path ( v , k ) else : if path : if not v : # 当v为Fasle时，把它赋值None，已方便删除该key v = None _t = "{},{},{}" . format ( path , k , v ) t2 = _t . split ( ',' ) for n , value in enumerate ( t2 ) : # 遍历t2,转换里面为存数字的str为int try : t2 [ n ] = int ( value ) except : pass self . d_list . append ( t2 ) else : self . d_list . append ( [ k , v ] )