add bash-readme
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import csv
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
def csv_to_ics(csv_file_path):
|
||||
ics_content = [
|
||||
"BEGIN:VCALENDAR",
|
||||
"VERSION:2.0",
|
||||
"PRODID:-//MUT_TS//Birthdays//RU",
|
||||
"CALSCALE:GREGORIAN"
|
||||
]
|
||||
|
||||
with open(csv_file_path, mode='r', encoding='utf-8') as file:
|
||||
# Предполагаем, что разделитель - запятая. Если точка с запятой, измените на delimiter=';'
|
||||
reader = csv.DictReader(file, delimiter=';')
|
||||
|
||||
|
||||
return reader
|
||||
|
||||
|
||||
|
||||
# Запуск конвертации
|
||||
print(list(csv_to_ics('1.csv')))
|
||||
print("Файл birthdays.ics успешно создан!")
|
||||
Reference in New Issue
Block a user