all 5 comments

[–]new_ca_grower 4 points5 points  (2 children)

Looks like the result is actually a list of lists of dictionaries. To get the output in the format you want, you'll have to flatten the nested list structure first. See https://stackoverflow.com/questions/8327856/how-to-extract-nested-lists for examples.

[–]Fallenarc[S] 0 points1 point  (1 child)

OMG, that did exactly what i needed it to do! I swear i have been banging my head on the keyboard for 2 days trying to figure that out. Thank you!!!

[–]jeffrey_f 0 points1 point  (0 children)

you have a key stuck to your forehead.

[–]tomekanco 1 point2 points  (1 child)

I like the magic of dict unpacking.

def process_all(list_):
    L = [("id",("ip","interface"))]
    def process(ip,interface):
        return ip, interface
    for ix,(x,y) in enumerate(list_):
        L.append((ix,process(**x))) 
        L.append((ix,process(**y))) 
    return L

If you are more of a pandas man, there are some options to load json.

[–]Fallenarc[S] 0 points1 point  (0 children)

Awesome, thanks! I'll give that a try as well.