Код: Выделить всё
[
{
"Topic Id": null,
"Topic Name": null,
"Topic Title": null,
"Topic Summary": null,
"Topic Matching Information": null,
"Actions": {
"actions": [
{
"action_id": "1",
"action_title": "Review Video",
"action_summary": "Watch the video",
"assigned_to": "nomail@email.com",
"due_date": "2024-05-24",
"action_attachments": [],
"action_owner": "Rumble",
"action_status": "Open"
},
{
"action_id": "2",
"action_title": "Review Barker Dam Annual Spill",
"action_summary": "Read the email about Barker Dam\u2019s Annual Spill Expected in Coming Days.",
"assigned_to": "noemail@email.com",
"due_date": "2024-05-24",
"action_attachments": [],
"action_owner": "Your Lower Chautauqua neighbors",
"action_status": "Open"
}
]
}
},
{
"Topic Id": "new_topic_001",
"Topic Name": "G-File Notification",
"Topic Title": "G-File Update Notification",
"Topic Summary": "Notification about the absence of today's G-File and an update on upcoming content.",
"Topic Matching Information": {
"subject": "About Today\u2019s G-File",
"sender": "",
"recipient": "",
"keywords": [
"G-File",
"newsletter"
]
},
"Actions": {
"actions": [
{
"action_id": "1",
"action_title": "Review Today's G-File",
"action_summary": "John Smith needs to review the G-File sent on 2024-05-17.",
"assigned_to": "John Smith",
"due_date": "2024-05-18",
"action_attachments": [],
"action_owner": "John Smith",
"action_status": "None"
}
]
}
}
]
Код: Выделить всё
for this_topic in topics:
for this_action in this_topic["Actions"]["actions"]:
Я постоянно получаю сообщение об ошибке:
Код: Выделить всё
TypeError: list indices must be integers or slices, not str
Подробнее здесь: https://stackoverflow.com/questions/785 ... -in-python