for path in paths:
    for dirpath, dirnames, filenames in os.walk(path):
        for filename in filenames:
            full_path = os.path.join(dirpath, filename)
hashobj = hash()
for chunk in chunk_reader(open(full_path, 'rb')):
    hashobj.update(chunk)
file_id = hashobj.digest(), os.path.getsize(full_path)
duplicate = hashes.get(file_id, None)
if duplicate:
    print('Duplicate found: %s and %s' % (full_path, duplicate))
else:
    hashes[file_id] = full_path
if sys.argv[1:]:
    check_for_duplicates(sys.argv[1:])
else:
    print('Please pass the paths to check as parameters to the script')
Finding duplicate files and removing them