I am writing a program in Python that stores information for each file in the system. When it is installed, it will move through each file, but then I want to update it whenever a new file is created or when the file is moved. For example, in the Dropbox service, whenever I copy a file to my Dropbox directory, it immediately notices and uploads it to its server.
Is there a way to do this in Python without polling? I am thinking of some kind of event listener that fires when a file is created.
source
share