擅长:python、mysql、java
<p>PyInotify可以轻松地监视目录:</p>
<pre><code>notifier = pyinotify.Notifier(wm, handler)
wm.add_watch('/tmp', pyinotify.IN_CREATE)
notifier.loop()
</code></pre>
<p>完整的教程在这里:<a href="https://github.com/seb-m/pyinotify/wiki/Tutorial#1-using-the-notifier-class-without-timeout" rel="nofollow">https://github.com/seb-m/pyinotify/wiki/Tutorial#1-using-the-notifier-class-without-timeout</a></p>