如何监视Python文件的更改? [英] How to monitor Python files for changes?

查看:175
本文介绍了如何监视Python文件的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果代码被改变,我想重新启动我的Python Web应用程序。但可能有大量的文件可以改变,因为在导入的模块中的文件可能会改变...



如何从导入的包/模块?



如何有效地检测修改后的Python文件?有没有一个库来做到这一点?

无耻的插件。还有 http://github.com/gorakhargosh/watchdog ,我正在努力做到这一点。

HTH。


I want to restart my Python web application, if code gets changed. But there could be a large number of files that could be changed, since files in imported modules could change ...

How to get the actual file names from imported packages / modules?

How can modified Python files be detected efficiently? Is there a library to do that?

解决方案

Shameless plug. There's also http://github.com/gorakhargosh/watchdog that I'm working on to do exactly this.

HTH.

这篇关于如何监视Python文件的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆