简体   繁体   English

在线监控python脚本的进度,或在我的手机上,或另一台计算机上

[英]Monitoring the progress of a python script online, or on my phone, or another computer

I have a python script that runs for a few hours.我有一个运行几个小时的 python 脚本。 There is some probability of it failing or hanging.它有一些失败或挂起的可能性。 Therefore, I would like to find a way to monitor this script's progress while away from the computer it runs on.因此,我想找到一种方法来监视此脚本的进度,同时远离它运行的计算机。 I have been looking into multiple options, but none of them are robust and straightforward enough.我一直在研究多种选择,但没有一个足够强大和直接。

If someone has some ideas, I'd love to hear them.如果有人有一些想法,我很想听听。

Here are some options I considered:以下是我考虑过的一些选择:

  • The computer running python is connected to my dropbox account.运行python的计算机连接到我的保管箱帐户。 Therefore, I could write an HTML file to my dropbox.因此,我可以将 HTML 文件写入我的保管箱。 This would work on other computers.这将适用于其他计算机。 I could open the HTML file on another computer and refresh the page to get the latest version.我可以在另一台计算机上打开 HTML 文件并刷新页面以获取最新版本。 However, this would not work on my phone.但是,这不适用于我的手机。 It would also not push any updates (not necessary, but that would be a great feature).它也不会推送任何更新(不是必需的,但这将是一个很棒的功能)。

  • I looked into building an online dashboard that would visualize data.我考虑构建一个可以可视化数据的在线仪表板。 The idea would be to update the data as the script runs, thereby getting the script's latest state.这个想法是在脚本运行时更新数据,从而获得脚本的最新状态。 I looked into plotly and anvil.我调查了情节和铁砧。 However, I could not find a way of programmatically updating the data online.但是,我找不到以编程方式在线更新数据的方法。

As a very simple quick fix you could make a log file and have it update it at intervals.作为一个非常简单的快速修复,您可以制作一个日志文件并定期更新它。 Pretty straightforward.很简单。

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

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