使用python中的API从google日历名称获取googlecalendarId

2024-09-28 01:30:37 发布

您现在位置:Python中文网/ 问答频道 /正文

如何使用API检索google日历上各种日历的日历ID,我知道使用

page_token = None
while True:
  calendar_list = service.calendarList().list(pageToken=page_token).execute()
  for calendar_list_entry in calendar_list['items']:
    print calendar_list_entry['summary']
  page_token = calendar_list.get('nextPageToken')
  if not page_token:
    break

它将返回名称,但我想让它返回CalendarId


Tags: tokennoneapiidtrueexecuteservicegoogle
1条回答
网友
1楼 · 发布于 2024-09-28 01:30:37

google API ^{} resource representation

你可以打印出条目本身,而不是一个键。在

page_token = None
while True:
  calendar_list = service.calendarList().list(pageToken=page_token).execute()
  for calendar_list_entry in calendar_list['items']:
    print calendar_list_entry
  page_token = calendar_list.get('nextPageToken')
  if not page_token:
    break

或直接获取id

^{pr2}$

相关问题 更多 >

    热门问题