要监控Python文件的变化,可以使用第三方库watchdog。以下是一个简单的示例代码,演示如何使用watchdog库监控指定目录下Python文件的变化:
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class PythonFileHandler(FileSystemEventHandler):
def on_modified(self, event)

最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



