The goal: from the string below I need to extract, side by side, the 'key' value and the 'query' value, which are returned by an API.
I'm not a Python expert, but to me it seems that the API that I'm hitting returns a dictionary inside a list, which themselves are inside a dictionary.
That seems to be the crux of the issue [the involvement of the list]. Note, the API may return multiple lines such as the one below.
{'Condition1': 'True', 'Load': 'Normal', 'query': 'xyz', 'results': [{'F1': 'abc', 'F2': 'def','Key': 'dfg4325'}]}
from the example above, I'm trying to retrieve a combined string that would be i.e. like a CSV as follows:
'xyz','dfg4325'
I've tried a number of tactics but nothing is working. The 'key' field inside the list's dictionary is always alpha-numeric - otherwise I'd have a hack for it.
Any thoughts would be appreciated. I googled this and just can't hit the right answer.