如果我在 Google 日历中写一些事件 例如:3 到 4 个事件,我如何启动 python 程序来使用 google API 获取所有这些事件?
event = service.events().get(calendarId='primary', eventId='eventId').execute()
print event['summary']
最佳答案
步骤1。您需要日历 ID。
第二步。你需要谷歌凭证。这启用了谷歌日历API的功能
#this code you can use at google app engine
def get_service():
from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
service = build('calendar', 'v3', credentials=credentials)
return service
step3然后调用事件列表函数
service = get_service()
events = service.events().list(calendarId='calendarId').execute()
引用https://developers.google.com/calendar/v3/reference/events/list
关于python - 如何使用 API 从 Google 日历获取事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55568820/