【问题标题】:Insert a list into google sheets using gspread使用 gspread 将列表插入谷歌表格
【发布时间】:2018-07-11 05:43:52
【问题描述】:

list = [['Akbar',1,34],['lata',1,56],['sita',5,45]]

我想将此列表插入为

cell_list = worksheet.range('A1:C7')

for cell in cell_list:
    cell.value = 'O_o'

# Update in batch
worksheet.update_cells(cell_list)

gspread 3.0.1 文档中提到了这一点,有什么直接的吗?和以前的版本一样吗?(3.0.0)

spread_sheet.values_update(
             RANGE, 
             params={'valueInputOption': 'RAW'}, 
             body={'values': list}
         )

【问题讨论】:

    标签: python google-sheets google-sheets-api gspread


    【解决方案1】:

    这会有帮助吗?

    for i in range(len(your_list)):
        l = your_list[i]
        for j in range(len(l)):
            x = l[j]
            spread_sheet.update_cell(i+1,j+1,x)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-09
      相关资源
      最近更新 更多