使用 python 中的 API 从 Google 日历名称获取 google 日历 ID
Get google calendarID from Google calendar name using API in 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
它将 return 名称,但我想将其获取到 return CalendarId
google API calendarList
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
:
print calendar_list_entry["id"]
如何使用 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
它将 return 名称,但我想将其获取到 return CalendarId
google API calendarList
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
:
print calendar_list_entry["id"]