我正在使用以下 python 代码将行附加到谷歌工作表。
KEY = "--snip--"
SHEET = "Sheet1"
def update_gdoc():
gdc = gdata.spreadsheet.service.SpreadsheetsService()
gdc.email = gDataConstants.GDATA_USERNAME
gdc.domain = 'mydomain.com'
gdc.password = gDataConstants.GDATA_PASSWORD
gdc.source = 'API User Task'
gdc.ProgrammaticLogin()
entry = gdata_utils.sheetByName(gdc, KEY, SHEET)
wid = entry.id.text.split("/")[-1]
values = ["2013", "12323", "99898"]
keys = ["date" , "visitors", "atc"]
map = dict(zip(keys, values))
gdc.InsertRow(map, KEY, wid)
update_gdoc()
我得到的错误是
Traceback (most recent call last):
File "/Users/dapurv5/br/work/src/mobile/analytics/scripts/update_gdoc.py", line 27, in <module>
update_gdoc()
File "/Users/dapurv5/br/work/src/mobile/analytics/scripts/update_gdoc.py", line 25, in update_gdoc
gdc.InsertRow(map, KEY, wid)
File "/work/src/backend/python/gdata/spreadsheet/service.py", line 339, in InsertRow
converter=gdata.spreadsheet.SpreadsheetsListFromString)
File "/work/src/backend/python/gdata/service.py", line 1236, in Post
media_source=media_source, converter=converter)
File "/work/src/backend/python/gdata/service.py", line 1358, in PostOrPut
'reason': server_response.reason, 'body': result_body}
gdata.service.RequestError: {'status': 400, 'body': 'We're sorry, a server error occurred. Please wait a bit and try reloading your spreadsheet.', 'reason': 'Bad Request'}
有什么我想念的吗?