I have in Python this dictionary:
[('157.55.39.64', 4), ('188.165.15.192', 2), ('1.165.15.192', 1)]
where the first field is an IP adress and the other one represents how many times is present in a file.
I would like to have a json representation of it like this one:
[{"ip":"157.55.39.64","times":4},
{"ip":"188.165.15.192","times":2},
{"ip":"1.165.15.192","times":1}]
I tried using jsonify(dictionary), but I get this:
{"157.55.39.64":4, "188.165.15.192": 2, "1.165.15.192":1}
which is only one json item. I don't know either how to put the strings "ip" and "times" in order to appear in the json file.
Any help?