1import hashlib
2BLOCKSIZE = 65536
3hasher = hashlib.md5()
4with open('anotherfile.txt', 'rb') as afile:
5 buf = afile.read(BLOCKSIZE)
6 while len(buf) > 0:
7 hasher.update(buf)
8 buf = afile.read(BLOCKSIZE)
9print(hasher.hexdigest())
10