试图从名为dow的变量向weekdays:[0]添加值。在create_data = {"startDateTime":"2015-02-23T09:05:00-0600","endDateTime":"2015-02-23T10:05:00-0600","accessories":[],"customAttributes":[{"attributeId":"3","attributeValue":""},{"attributeId":"5","attributeValue":"Yes"}],"description":"Placeholder Description","invitees":[],"participants":[],"recurrenceRule":[{"type":"weekly","interval":2,"weekdays":[0],"repeatTerminationDate":"2015-05-24T09:50:00-0600"}],"resourceId":"15","resources":["15"],"title":"","userId":"26","startReminder":"","endReminder":""}
我搞不清是在词典中添加还是在列表中添加。在
尝试了以下方法,但却产生了以下错误:
^{pr2}$
以下是错误。在Traceback (most recent call last):
File "api.py", line 51, in
create_data['recurrenceRule']['weekdays'] = dow
TypeError: list indices must be integers, not str
如何访问该值?在