I have a table which is presented as Python's list of lists and I'd like to write it down to some Google Spreadsheet using gspread
library. However, it seems that gspread
does not have such function out of the box. Of course I can use loop and update particular cells but it is very inefficient solution because it have to perform multiple requests (one request per cell). How to do it better?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You can use
Worksheet.range
to select the range you want to update, then write down the contents of your table to this range and useWorksheet.update_cells
to update them in a batch.The following code snipped is adapted from this tutorial.
You can use it in the following way:
This recent answer to a similar question seems much simpler:
BTW, the code was provided by @Burnash (gspread developer)
You may use the following
update_sheet
function with the previous process for a more concise solution:Then: