我是python的新手.我只是想用gspread创建一个谷歌工作表.我从这里读到了关于使用google api的信息.我从Google Developers Console下载了凭据,该凭据是json格式的文件.然后我用了这段代码
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('spreadsheet1995.json', scope)
gc = gspread.authorize(credentials)
worksheet = gc.add_worksheet(title="A worksheet", rows="100", cols="20")
Run Code Online (Sandbox Code Playgroud)
但是,'Client' object has no attribute 'add_worksheet'尽管我阅读了包含此属性的文档,但它仍然会出错.这是我遵循的链接.请帮我解决这个问题.