我有一个像这样的json文件(简化):
{'pageSize': 1,
'vXPolicies':
[
{'columnType': 'Inclusion',
'id': 123,
'permMapList': [
{'groupList': ['kor1'], 'permList': ['Select1'], 'userList': []},
{'groupList': ['kor2'], 'permList': ['Select2'], 'userList': []}],
'policyName': 'DB_policy',
'version': '2'}]}
我想在“permMapList”下添加另一个列表:
{'groupList': ['kor3'], 'permList': ['Select3'], 'userList': []}
答案 0 :(得分:1)
您可以使用append
:
your_dict['vXPolicies']['permMapList'].append(
{'groupList': ['kor3'], 'permList': ['Select3'], 'userList': []})