所以我试图用python访问谷歌日历,并遇到了错误。这是我的代码:
from apiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
from oauth2client.file import Storage
SCOPES = 'https://www.googleapis.com/auth/calendar'
CLIENT_SECRET = r'C:\Users\Kids\Desktop\client_secret.json'
store = file.Storage(r'C:\Users\Kids\Desktop\storage.json')
creds = store.get()
GCAL = build('calendar','v3',http=creds.authorize(Http()))
这是错误:
Traceback (most recent call last):
File "C:/Users/Kids/redsox.py", line 17, in <module>
GCAL = build('calendar','v3',http=creds.authorize(Http()))
AttributeError: 'NoneType' object has no attribute 'authorize'