简体   繁体   中英

Insert a list into google sheets using gspread

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

I want this list inserted as

在此处输入图片说明

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

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

# Update in batch
worksheet.update_cells(cell_list)

This is mentioned in gspread 3.0.1 docs is there anything that is direct? like in the previous version?(3.0.0)

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

Would this help?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM