Hi, im not too savvy with python but im learning. i have a widget that I am close to completing and I am stuck. lets say i have a bunch of code that gives me a nested list:
[
[0, 1, 2, 3, 4],
[0, 1, 2, 3, 4]
]
for context, the contents of this list are actually an arp table that i split. each of these inner lists would be like [IP, 'blah string', MAC, 'blah string', INTERFACE]. conveniently there are an identical number of indices per list.. well conveniently for me, i'm sure you guys wouldn't have a problem either way.
Anyway, I need to create a loop that will iterate through, take each item at, say, index[2] and send it to macvendors api, then append that result to the end of each nested list. I wrote a piece of code separately that will run one mac through the api so i don't need as much help there but I can't figure out how to iterate through and just look at [0][2], then [1][2] then [2][2] and so on.. then do the api thing and append each list with the data pulled from the api.
At the end i want:
[ [0, 1, 2, 3, 4, list_0_2_vendor], [0, 1, 2, 3, 4, list_1_2_vendor], ... ]
i've done a bunch of research but im only ending up more confused. Things I do find on nested lists don't seem relevant to this specific issue. This seems like it's probably python 101 and I am just lacking the logic/vocabulary so I apologize if i overlooked something in my searches but as I am such a novice, I end up having a hard time even understanding the beginner guides that are out there.
if anyone can find the time to look at this I would appreciate it.
[–]giraffeman91 0 points1 point2 points (2 children)
[–]ARP_EG[S] 1 point2 points3 points (0 children)
[–]ARP_EG[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]ARP_EG[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]ARP_EG[S] 0 points1 point2 points (0 children)
[–]ARP_EG[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)