This code creates a new calendar and adds a single event to it. The `to_ical()` function then converts the calendar to a string and the result is printed on the console. Example 2: Parsing an existing iCalendar file and converting it to a stringpython from icalendar import Calendar import requests # Download an iCalendar file from the internet response = requests.get('https://example.com/calendar.ics') # Parse the iCalendar data ical_data = response.content cal = Calendar.from_ical(ical_data) # Convert the calendar to a string and print it ical_str = cal.to_ical() print(ical_str.decode()) ``` This code downloads an iCalendar file from the internet and parses it using the `from_ical()` function. The resulting calendar object is then converted to a string using `to_ical()` and printed on the console.