【问题标题】:How to create/list events in calendars other than default using Google's API for Python?如何使用 Google 的 Python API 在日历中创建/列出默认事件以外的事件?
【发布时间】:2011-12-14 04:47:11
【问题描述】:

使用gdata API for Python,如何在默认日历之外的日历中创建或列出事件?

【问题讨论】:

    标签: python google-calendar-api gdata-api


    【解决方案1】:

    您必须获取要读取/写入的自定义日历的 url,并在事件查询中提供它。这是我想出的:

    #define cal_client:
    self.cal_client = gdata.calendar.client.CalendarClient(source='Milosz-GCal-1.0')
    #initiate calendar service (log in):
    self.cal_client.ClientLogin(email, password, self.cal_client.source);
    #get url for custom calendar (cal_index):
    self.cal_url=self.cal_client.GetOwnCalendarsFeed().entry[self.cal_index].GetAlternateLink().href
    #then, to read from the custom calendar:
    self.feed=self.cal_client.GetCalendarEventFeed(self.cal_url)
    #and to write to custom calendar:
    new_event = self.cal_client.InsertEvent(event,self.cal_url)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      相关资源
      最近更新 更多