def timecheck(files):
 global _mtimes
 for filename in files:
  mtime = os.stat(filename).st_mtime
  if (filename not in _mtimes):
   _mtimes[filename] = mtime
  elif (mtime != _mtimes[filename]):
   _mtimes = {}
   return True
 else:
  return False

def timecheck ( files ) : global _mtimes for filename in files : mtime = os . stat ( filename ) . st_mtime if ( filename not in _mtimes ) : _mtimes [ filename ] = mtime elif ( mtime != _mtimes [ filename ] ) : _mtimes = { } return True else : return False
return true if any of the files have changed .