How do I watch a file for changes?

前端 未结 25 2769
孤街浪徒
孤街浪徒 2020-11-21 07:13

I have a log file being written by another process which I want to watch for changes. Each time a change occurs I\'d like to read the new data in to do some processing on it

25条回答
  •  离开以前
    2020-11-21 08:03

    Did you try using Watchdog?

    Python API library and shell utilities to monitor file system events.

    Directory monitoring made easy with

    • A cross-platform API.
    • A shell tool to run commands in response to directory changes.

    Get started quickly with a simple example in Quickstart...

提交回复
热议问题