def crc_check(path, target_crc):
 try:
  fp = open(path, 'rb')
 except:
  return False
 crc = binascii.crc32('')
 while 1:
  data = fp.read(4096)
  if (not data):
   break
  crc = binascii.crc32(data, crc)
 fp.close()
 crc = ('%08x' % ((crc & 4294967295),))
 return (crc.lower() == target_crc.lower())

def crc_check ( path , target_crc ) : try : fp = open ( path , 'rb' ) except : return False crc = binascii . crc32 ( '' ) while 1 : data = fp . read ( 4096 ) if ( not data ) : break crc = binascii . crc32 ( data , crc ) fp . close ( ) crc = ( '%08x' % ( ( crc & 4294967295 ) , ) ) return ( crc . lower ( ) == target_crc . lower ( ) )
return true if file matches crc .