python - 以编程方式将 ICS 文件导入 iCalendar

标签 python icalendar

我使用 iCalendar 模块和 python 编写了一个 ICS 文件。

我的问题是,如何告诉 iCalendar 读取 ICS 文件?我以为我可以把它放在 ~/Library/iCalendar/<--->/Events 中,但似乎只在导入 ICS 文件后才存储它们。

有谁知道我可以做到这一点的方法吗?

谢谢

最佳答案

您将使用 Applescript 或 Python scripting bridge framework 。无论哪种情况,请告诉 iCal 添加事件。

示例(Applescript):

tell application "iCal"
   tell calendar "Work"
      set theDate to current date
      make new event at end with properties {description:"The Event Description", 
         summary:"Event Name", location:"Main Street", start date:theDate, 
         allday event:true}
   end tell
end tell

或者使用相同的方法告诉 iCal 打开并导入该文件。

关于python - 以编程方式将 ICS 文件导入 iCalendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8495145/

相关文章:

python - 学习编码,进行 Nose 测试时出现语法错误,我看不到错误

python - 值错误 : Length mismatch: Expected axis has 0 elements while creating hierarchical columns in pandas dataframe

c# - 无法订阅使用 dday.ical 创建的 webcal 提要

google-calendar-api - 有关生成 iCal Feed 的问题

类似于 iCal 的 Cocoa 弹出窗口

python - 如何将 JPEG 图像插入 python Tkinter 窗口?

python - 利用洪水填充算法确定等高 map 区域

python - `.create()` 方法默认不支持可写嵌套字段。

java - 使用 iCal4j 设置 Activity 时间

javascript - window.open 在 IE 中无法下载事件