【发布时间】:2016-04-22 06:15:49
【问题描述】:
“保持与 google 电子表格的连接处于活动状态”有几个示例 但我发现的所有内容都是基于“旧”的 Google 登录系统,该系统自 2015 年 4 月起不再工作
使用 OAuth 2.0 保持与 googlespreadsheet 的连接的正确方法是什么
我试过了
import gspread
from oauth2client.service_account import ServiceAccountCredentials
headers = gspread.httpsession.HTTPSession(headers={'Connection':'Keep-Alive'}) #Allows a persistant connection.
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('Apps Script Execution API.json', scope)
c = gspread.authorize(auth=credentials,http_session=headers)
结果: c = gspread.authorize(auth=credentials,http_session=headers) TypeError: authorize() got an unexpected keyword argument 'auth'
【问题讨论】:
标签: python google-spreadsheet-api gspread