Do you just want to know if they are equal? If that is the case, you can simply use:
# compare two files and check if they are equal
# files can be binary or text based
# pick two files you want to compare ...
file1 = "Boing1.wav"
file2 = "Boing2.wav"
if filecmp.cmp(file1, file2):
print "Files %s and %s are identical" % (file1, file2)
print "Files %s and %s differ!" % (file1, file2)
First you have to define "equal". If it means any difference at all then first, see if the two files have the same length. If not, then they are not equal, If they are the same length, open each one in binary mode and read a fixed number of bytes from each, then compare for equality. Repeat until the end of file is reached or they are not equal, in which case you can print or return where they differ.