Feb-05-2020, 10:04 PM
Alright, I found a working solution for me.
For this example, my dictionary gets produced and stored to an object called 'inbound_dict'.
The following code works to return just the latest dictionary added to the set.
Now I think I can just convert to string and strip off what I don't want.
For this example, my dictionary gets produced and stored to an object called 'inbound_dict'.
The following code works to return just the latest dictionary added to the set.
Now I think I can just convert to string and strip off what I don't want.
def get_latest(cached): latest_key = max(cache.keys()) return cache[latest_key]["body"] ... ...**code that generates the dictionary** ... cached=inbound_dict cached={k: get_latest(cached[k]) for k in cached.keys()} print(cached)