[英]Auto-run a python script without reloading dependencies
I'm working on a project that requires a lot algorithm development and data visualization. 我正在一个需要大量算法开发和数据可视化的项目上。 The workflow involves lots of small tweaks, with checks to see if the output matches expectations.
工作流涉及许多细微调整,并进行检查以查看输出是否符合期望。
To fit that workflow, I'm trying to set up my work environment to be very responsive: 为了适应该工作流程,我试图将自己的工作环境设置为响应迅速:
Currently, I'm using watchdog's watchemdo utility to re-run scripts every time they're edited. 目前,我正在使用watchdog的watchemdo实用程序来在每次编辑脚本时重新运行它们。 The problem is that all the scripts have large-ish dependencies (matplotlib, etc.) that take a couple of seconds to load.
问题在于所有脚本都具有很大的依赖项(matplotlib等),这些依赖项需要花费几秒钟来加载。 It's not much, but it really slows down the workflow.
数量不多,但确实减慢了工作流程。
Can anyone recommend an architecture/utility/etc. 任何人都可以推荐架构/实用程序/等。 that satisfies 1, 2, 3, and (ideally) 4 as well?
满足1、2、3和(理想情况下)4?
I figured it out. 我想到了。 watchmedo was close, but wouldn't support requirements 3 and 4.
watchmedo很接近,但不支持要求3和4。
Here's a nice little script that meets all my requirements: 这是一个可以满足我所有要求的漂亮小脚本:
https://gist.github.com/abegong/bc4310de32ca25be73d8 https://gist.github.com/abegong/bc4310de32ca25be73d8
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.