Skip to content

Instantly share code, notes, and snippets.

@mutaku
Created August 14, 2013 20:40
Show Gist options
  • Save mutaku/6235347 to your computer and use it in GitHub Desktop.
Save mutaku/6235347 to your computer and use it in GitHub Desktop.
>>> import Queue
>>> import os
>>> os.chdir("c:/users/matthew/watchdog")
>>> from watchdog import WatchDog
>>> import threading
>>> class WD(threading.Thread):
... def run(self):
... while True:
... path = pathPool.get()
... if path:
... w = WatchDog(path, 2)
... w.monitor()
...
>>> pathPool = Queue.Queue(0)
>>> dirs = ["c:/users/matthew/watchdog", "c:/users/matthew/pyimgur"]
>>> for x in xrange(len(dirs)):
... WD().start()
...
>>> for dir in dirs:
... pathPool.put(dir)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment