title: Python library to detect if a file has changed between different runs?
body: <p>Suppose I have a program A. I run it, and performs some operation starting from a file foo.txt. Now A terminates.  </p>
  
  <p>New run of A. It checks if the file foo.txt has changed. If the file has changed, A runs its operation again, otherwise, it quits.</p>
  
  <p>Does a library function/external library for this exists ?</p>
  
  <p>Of course it can be implemented with an md5 + a file/db containing the md5. I want to prevent reinventing the wheel.</p>