Python script controller malfunctioning

I am trying to use Python Watchdog to monitor a directory for changes. However, when I try to run the Quickstart example:

import time from watchdog.observers import Observer from watchdog.events import LoggingEventHandler if __name__ == "__main__": event_handler = LoggingEventHandler() observer = Observer() observer.schedule(event_handler, path='.', recursive=True) observer.start() try: while True: time.sleep(1) except KeyboardInterrupt: observer.stop() observer.join() 

inserting the test.py file into it, nothing is displayed in the terminal window where I ran it. What causes this, and how can I fix it?

+8
python
source share
1 answer

Try an example on github: https://github.com/gorakhargosh/watchdog

This example seems to work, not the one on the docs site does not work.

+14
source share

All Articles