📜  python循环列表 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:44.611000             🧑  作者: Mango

代码示例1
dict_list = [This is the list with 9000 dicts]
batch_list = []
return_list = []

for i in dictlist:
    batch_list.append(i)
    if len(batch_list)  == 100:
        return_list.append(API_CALL_FUNCTION(batch_list))
        batch_list.clear()

if batch_list:
    return_list.append(API_CALL_FUNCTION(batch_list))