Python Gsheets insert_行正在跳过d

2024-09-30 20:27:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个双嵌套字典,其中返回的值是一个列表,其中包含一个人的特征。我想把列表中的每一个值都写到谷歌表单中,所以我使用了gspread。这是我的密码:

for person in list_id: 
    index = 2

    for key, value in enrich_dict.items():

        for keytwo, valuetwo in value.items():
            row = [valuetwo[0], valuetwo[1], valuetwo[2], valuetwo[3], person] 
            sheet.insert_row(row, index)
            index += 1

出于某种原因,valuetwo[3]从未插入到工作表中,我只得到4列数据。无论我使用什么数据进行测试(尝试使用简单字符串),情况总是如此,第四个值被跳过


Tags: 数据in密码表单列表forindex字典