Aug-14-2021, 12:09 AM
I am making a DVD ripping script and I am trying to use the Watchdog Lib to trigger my main function. The problem is, I'm getting this error:
This is my test code if that helps anyone and if anyone has any questions feel free to ask.
Error:PermissionError: [WinError 21] The device is not ready.
Is there a way for Watchdog to wait till it's loaded? This is my test code if that helps anyone and if anyone has any questions feel free to ask.
from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler event_handler = FileSystemEventHandler() # calling test functions event_handler.on_created = lambda : print("created") event_handler.on_deleted = lambda : print("deleted") event_handler.on_modified = lambda : print("modified") event_handler.on_moved = lambda : print("moved") path = "D://" observer = Observer() observer.schedule(event_handler, path, recursive=True) observer.start() try: print("Monitoring") while True: time.sleep(1) except KeyboardInterrupt: observer.stop() print("Terminating") observer.join()