【发布时间】:2016-05-18 07:36:34
【问题描述】:
您好 stackoverflow 社区, 我是 python 新手。我想使用 gspread 编辑谷歌电子表格。以下是我正在使用的代码:
import json
import gspread
from oauth2client.service_account import ServiceAccountCredentials
json_key = json.load(open('My Project-f3f034c4a23f.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('My Project-f3f034c4a23f.json', scope)
gc = gspread.authorize(credentials)
worksheet = gc.open('Roposo')
worksheet.update_acell('B1', 'Gspread!')
我收到错误:
Traceback(最近一次调用最后一次): 文件“C:\Users\user\Desktop\Python\spreadsheet.py”,第 16 行,在 cell_list = worksheet.range('A1:C7') AttributeError:“电子表格”对象没有属性“范围”
请告诉一个合适的解决方案。
【问题讨论】:
标签: python google-sheets gspread