开发者

How to add an event with content to a non-default google calendar?

开发者 https://www.devze.com 2023-03-11 14:57 出处:网络
I have refer to http://www.pauldeden.com/2009/01/creating-application-to-insert-events.html to add an quick event with title and time but without content to a non-default google calendar using python.

I have refer to http://www.pauldeden.com/2009/01/creating-application-to-insert-events.html to add an quick event with title and time but without content to a non-default google calendar using python.

if i use

event.content = a开发者_运维技巧tom.data.Content(text=content)

to give content to the event,the console of Ubuntu says:

AttributeError:'Content' object has no attribute '_BecomeChildElement'

What does it mean?How to solve it?


I would need your code to be sure, but I believe you are not creating the variable content correctly. You should be careful to make sure that content is of type content when initializing it. Maybe you are just using it as a string?

With your code I can provide a better answer.

Have you tried with the new v3 API? It is very simple.

created_event = service.events().quickAdd(
    calendarId='primary',
    text='Appointment at Somewhere on June 3rd 10am-10:25am').execute()

print created_event['id']
0

精彩评论

暂无评论...
验证码 换一张
取 消