Answer the question
In order to leave comments, you need to log in
Python how to replace list in json?
I have such a date {'trainings': [словарь]
When data['trainings'] = [more than other dictionaries], a double bracket is added {'trainings': "[больше других словарей]"
What destroys the whole structure, how to avoid this? Take elements from the dictionary and somehow append the list?
Answer the question
In order to leave comments, you need to log in
>>> import json
>>> a = {"trainings": [{"more": "dicts"}, {"and": "even_more"}]}
>>> json.dumps(a)
'{"trainings": [{"more": "dicts"}, {"and": "even_more"}]}'
>>>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question