Because your data is still a list. You need to get the content from the list and this is your dict.
The for-loop ist nested with a second for-loop.
In my example, I do the following:
BTW: if you save the data in the right format, all these steps are not required. Look at the answer above,
The for-loop ist nested with a second for-loop.
In my example, I do the following:
- open the file
- iterate over lines (3 in total) [first level of iteration]
- parse with literal_eval the single line, which results into a list.
- iterate over the list (from literal_eval) to get the list elements [second level of iteration]
- update the result dict, with the elements (dicts) from the list (result =| element)
- process the IPAddress to correct this entry
BTW: if you save the data in the right format, all these steps are not required. Look at the answer above,
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!