【问题标题】:How to read data from google sheet through google app engine?如何通过谷歌应用引擎从谷歌表格中读取数据?
【发布时间】:2021-02-26 20:56:00
【问题描述】:

我有一个本地烧瓶应用程序正在从 csv 文件中读取数据。使用下面的代码,我能够成功地从名为“Vocab”的电子表格的第一列和第二列中读取数据。 “service_account.json”当前与我的其他应用程序文件一起保存在我的本地工作目录中。

    gc = gspread.service_account(filename='service_account.json')
    sh = gc.open("Vocab")
    worksheetOne = sh.sheet1
    self.columnOne = [str(i) for i in worksheetOne.col_values(1)]
    self.columnTwo = [str(i) for i in worksheetOne.col_values(2)]

我现在正在尝试将此烧瓶应用程序部署到谷歌应用程序引擎,但我不确定如何替换我用于凭据的本地“service_account.json”文件,以便能够访问我的谷歌表信息。从我的谷歌应用程序访问我的谷歌表格信息的最佳方式是什么?

【问题讨论】:

  • 您可以在您的应用中部署service_account.json 并以同样的方式进行操作吗?
  • 是的,我可以!轻松修复

标签: python google-app-engine flask google-sheets


【解决方案1】:

为什么需要更换它?您可以将其包含在部署中,以便以相同的方式读取它

【讨论】:

    猜你喜欢
    • 2013-05-17
    • 2014-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多