小编Cou*_*er0的帖子

Google Sheets API Python-清除工作表

我想不断更新/重写为Google工作表。但是,我不能不更新旧表就更新它,因为有时更新的行少于表中的前一行和旧行。

因此,开发人员页面上列出的协议为:

{
  "requests": [
    {
      "updateCells": {
        "range": {
          "sheetId": sheetId
        },
        "fields": "userEnteredValue"
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我认为翻译成python看起来像这样:

requests = [{ 'updateCells': { 'range': { 'sheetId': spreadsheet_id }, 'fields': 'userEnteredValue' } }]

body = { 'requests': requests }
spreadsheet_id='[uniqueIDhere]'

result = service.spreadsheets( ).values( ).batchUpdate(spreadsheetId=spreadsheet_id, body=body ).execute( )
Run Code Online (Sandbox Code Playgroud)

返回错误:

googleapiclient.errors.HttpError:https://sheets.googleapis.com/v4/spreadsheets/[uniqueIDhere]/values:batchUpdate?alt=json返回“接收到无效的JSON有效负载。未知名称“ requests”:找不到字段。“>

似乎很奇怪,“请求”无效,因为它在协议中列出了。无论如何,还有其他人可以使用它吗?谢谢。-杰森

python google-api google-sheets-api

4
推荐指数
1
解决办法
3540
查看次数

wxMessageBox在python中返回什么?

我正在寻找简单的wx.MessageBox返回值示例.我看过一些基本的例子,看起来很像这样.到目前为止,我有:

dlg = wx.MessageBox( 'What do you choose?, 'Test Dialog', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION )
if dlg == wx.ID_YES:
    print 'You picked yes'
Run Code Online (Sandbox Code Playgroud)

dlg似乎返回8表示否,2表示肯定.但是wx.ID_YES = 2503和wx.ID_NO = 5104

谢谢你的时间.

python wxpython

3
推荐指数
1
解决办法
3469
查看次数

标签 统计

python ×2

google-api ×1

google-sheets-api ×1

wxpython ×1