How to merge two json string in Python?

后端 未结 6 2081
醉酒成梦
醉酒成梦 2020-12-08 10:20

I recently started working with Python and I am trying to concatenate one of my JSON String with existing JSON String. I am also working with Zookeeper so I get the existing

6条回答
  •  庸人自扰
    2020-12-08 11:08

    What do you mean by merging? JSON objects are key-value data structure. What would be a key and a value in this case? I think you need to create new directory and populate it with old data:

    d = {}
    d["new_key"] = jsonStringA[] + \ 
                   jsonStringB["timestamp_in_ms"]
    

    Merging method is obviously up to you.

提交回复
热议问题