擅长:python、mysql、java
<p>数据库触发器用于DELETE、INSERT和updatesql查询。不能用它触发python脚本。你知道吗</p>
<p>在某个时候,可以使用updatesql查询将数据库字段设置为0或1。你知道吗</p>
<p>基于事件的方法是在执行sql update查询之前或之后运行相应的python脚本。Python可以在pi上作为web服务器运行,您可以通过GET或POST发送值。你知道吗</p>
<p>轮询方法是使用python脚本或类似脚本每隔x(mili)秒查询一次数据库,并相应地执行打开/关闭函数。你知道吗</p>