如何解决当我使用 Chat.db 和 Python 收到新的 iMessage 时执行操作
每次收到新的 iMessage 时,我想将它与预定义的字符串进行比较,如果新 iMessage 与预定义的字符串匹配,我想执行一个操作。
我可以通过以下方式获取表格:
# find your chat.db and establish a connection
conn = sqlite3.connect('/Users/ParthJadhav/Library/Messages/chat.db')
cur = conn.cursor()
# query the database to get all the table names
cur.execute(" select name from sqlite_master where type = 'table' ")
for name in cur.fetchall():
print(name)
我想获取'text'字段的'message'表的最新条目并进行比较。
提前致谢:)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。