i have a following json that i want to read with Python and save table_name and column_filter in a variable in each iteration.
My json is like:
import json
dict_config = json.loads('''
{
"normal" : [
{
"table_name": "TABLE1",
"column_filter": "TIME_TS"
},
{
"table_name": "TABLE2",
"column_filter": "TIME_DATE_TS"
}
],
"normal2" : [
{
"table_name": "TABLE3",
"column_filter": "SOMETHING_TS"
},
{
"table_name": "TABLE4",
"column_filter": "DOCUMENT_TS"
}
]
}
''')
for each in dict_config.keys():
for xx in dict_config[each]
...
table_name=...
column_filter=.....
How can i easily store value for of table_name and column_filter in normal,normal2,... element?
So in each iteration i want to get table_name & column_filter
question from:
https://stackoverflow.com/questions/65916450/get-elements-from-a-json-dictionary-with-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…