Code Monkey home page Code Monkey logo

Comments (5)

kuzmoyev avatar kuzmoyev commented on June 12, 2024

calendar.add_event(event) returns a created event with the set id. So replace this line with

event = calendar.add_event(event)

And everything should work.

But if adding the attendee is the only update you do to the event, you can just add attendee before add_event:

...
attendee = Attendee('[email protected]')
event = Event('Prueba', 
               start=(25 / Oct / 2022)[21:58], 
               minutes_before_email_reminder=20, 
               attendees=attendee)
calendar.add_event(event)

Also, glad to see that you are using beautiful-date 😊

from google-calendar-simple-api.

flashstacks06 avatar flashstacks06 commented on June 12, 2024

Thank you so so much, it works, and the reason for using the instruction attendee instead of just adding in event instruction is that I wanna make a function where a can only enter emails and be able to delete them as well as add them, and a think I cloud do that with a for, I don't know, what do u think?

from google-calendar-simple-api.

flashstacks06 avatar flashstacks06 commented on June 12, 2024

and btw, I love beautiful-date, its so easy to use, and very useful

from google-calendar-simple-api.

flashstacks06 avatar flashstacks06 commented on June 12, 2024

I used this code to do what I want to do, so it's here if u want to give me ur opinions or for whoever wanna do the same as me

from calendar import Calendar
from gcsa.event import Event
from gcsa.google_calendar import GoogleCalendar
from gcsa.recurrence import Recurrence, DAILY, SU, SA
from gcsa.attendee import Attendee

from beautiful_date import *


def classtogooglecal():


    calendar = GoogleCalendar('[email protected]',credentials_path='credentials.json')

    event = Event('Prueba',start=(25 / Oct / 2022)[21:58],minutes_before_email_reminder=20)

    event = calendar.add_event(event)

    emails = ["[email protected]","[email protected]"]

    for i in range(len(emails)):
        eachemail = emails[i]
        print(eachemail)
        attendee = Attendee(eachemail)
        event.add_attendee(attendee)

    calendar.update_event(event)

classtogooglecal()

from google-calendar-simple-api.

kuzmoyev avatar kuzmoyev commented on June 12, 2024

Happy that this resolved your issue.

I'll close the issue. If you have any other questions post them here or in the Discussions.

As for attendees, your approach is fine

from google-calendar-simple-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.