【发布时间】:2016-08-10 17:43:48
【问题描述】:
我正在使用 gspread 和服务帐户密钥、其他、json 文件。使用 python 2.7 不断更新谷歌电子表格。我有一个运行最新的 Raspian Jessie 的 Raspberry Pi。我的 oauth 和 gspread 都应该是适用于我的平台的最新版本。我的脚本运行一小时(最大令牌寿命),然后停止使用错误消息:“无效令牌:无状态令牌过期错误”我的代码如下
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
from httplib2 import Http
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name(filename.json,scope)
gc = gspread.authorize(credentials)
wks = gc.open('spreadsheet name')
p1 = wks.worksheet('Printer One')
def functon()
...
p1.append_row(printing)
任何帮助将不胜感激,谢谢。
【问题讨论】:
标签: python-2.7 google-oauth gspread