Remove events with same name

This commit is contained in:
2023-06-12 09:33:50 +02:00
parent 5117c0f4a2
commit 3e515a8f1a

View File

@@ -44,10 +44,16 @@ if calendar:
# Sort the events by start time
events.sort(key=lambda x: datetime.datetime.strptime(x[0], "%d.%m.%Y %H:%M:%S"))
# Remove Events with same summary
summarys = []
for summary in events:
if summary[1] not in summarys:
summarys.append(summary[1])
# Print the sorted events
for summary in events:
print('-', summary[1])
for summary in summarys:
print('-', summary)
else:
print('Calendar not found.')