读取图片的MD5值
targetPath = "G:\python\bookschina\ISBN\"
n = 0
for filename in os.listdir(r""+targetPath+""):
# listdir的参数是文件夹的路径
print(filename)
image_file = open(targetPath+filename,'rb').read()
print(hashlib.md5(image_file).hexdigest())
if hashlib.md5(image_file).hexdigest() == '0b2e0fcf3c510844b8981bf70afcfdf1':
n = n + 1
print(n)
0 评论
评论
登录后即可评论 去登录