【发布时间】:2021-11-02 14:54:05
【问题描述】:
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ["https://spreadsheets.google.com/feeds",'https://www.googleapis.com/auth/spreadsheets',"https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name("creds.json", scope)
client = gspread.authorize(creds)
sh=client.open("kite")
s0=sh.get_worksheet(0)
s1=sh.get_worksheet(1)
s0.batch_update([
{'range': 'A3', 'values':fin_5min},
{'range': 'D3', 'values': fin_15min}
])
我想用与s0 相同的数据更新s1 工作表。如何使用 gspread 在单个请求中执行此操作?
【问题讨论】:
标签: google-sheets google-sheets-api gspread