quick-add.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:handy-tools 作者: anuragbanerjee 项目源码 文件源码
def main():
    """
    Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object, logs the query from the arguments, and creates an event with Quick Add.
    """
    credentials = get_credentials()
    http = credentials.authorize(httplib2.Http())
    service = discovery.build('calendar', 'v3', http=http)

    if len(sys.argv) > 1:
        with open("log.txt", "a") as logfile:
            logfile.write(flags.query + "\n")
        created_event = service.events().quickAdd(
            calendarId='primary',
            text=flags.query
        ).execute()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号