简体   繁体   English

链接到Excel工作表并检查条件何时为真的Python脚本

[英]Python script that is linked to an excel sheet and checks when a condition is true

I am trying to write a python script that is linked to an ever updating excel sheet with lists of temperatures. 我正在尝试编写一个Python脚本,该脚本链接到具有温度列表的不断更新的Excel工作表。 We have stations in 15 countries that take record ocean/atmospheric temperatures at 10 min intervals and sends them to us, it runs 24/7/365. 我们在15个国家/地区设有站点,它们每隔10分钟记录一次创纪录的海洋/大气温度并将其发送给我们,运行时间为24/7/365。 The excel file is 10 columns wide and several thousand rows long, every 10 minutes there is a new row with new numbers. excel文件的宽度为10列,长度为几千行,每隔10分钟就有一行带有新数字的新行。 We are concerned when the difference between the temps changes too quickly or too slowly and we continuously check it by hand. 当温度之间的差异变化太快或太慢时,我们会感到担忧,我们会不断地手动检查。 We have several dozen conditions that we are constantly monitoring and checking by hand, usually just checking the latest row in a column to see if its in a certain (2 degree) range from a row that is 50 or 100 or 1000 rows above the latest row. 我们有数十种情况,我们会不断地进行手工监控和检查,通常只是检查一列中的最新行,以查看其是否在某个(2度)范围内,而该行距最新行的50或100或1000行以上行。 Has anyone worked with anything similar? 有没有人从事过类似的工作? I would basically like to write a script that is always running and checking is several conditions are true. 我基本上想编写一个始终在运行的脚本,并检查是否有多个条件成立。 I would like to be able to just write the 40 or 50 conditions into the script and anytime one of the conditions is TRUE i would get a notifications such as 'Condition number 8 is now true'. 我希望能够将40或50个条件写入脚本,并且只要条件之一为TRUE,我都会收到诸如“条件编号8现在为true”之类的通知。 Any suggestions on python libraries or books that I can use that are specifically for this purpose? 我可以为此目的使用的关于python库或书籍的任何建议吗?

First off, it sounds like your system would be far better if it was a webapp backed by an actual database. 首先,听起来如果您的系统是由实际数据库支持的Web应用程序,那么您的系统会更好。 This would be trivial to create based on your problem description so far. 到目前为止,根据您的问题描述进行创建将是微不足道的。 That aside, this looks like what you want: http://www.python-excel.org/ 除此之外,这看起来像您想要的: http : //www.python-excel.org/

Run your script with a cron job (or scheduled task if your on windows) and you should be golden. 使用cron作业运行脚本(如果在Windows上运行,则运行计划任务),您应该会很聪明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM