-1
我正在使用以下python代碼將行附加到Google工作表。從Python代碼寫入Google Spreadsheet代碼
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'}
什麼我很想念?
你會想無效該鍵... – Qix