Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import os
  2. import hashlib
  3.  
  4. hashes = {}
  5. for root, dirs, files in os.walk("."):
  6. for f in files:
  7. if not f.endswith(".png"):
  8. continue
  9. fname = os.path.join(root, f)
  10. with open(fname, "rb") as openf:
  11. h = hashlib.md5(openf.read()).hexdigest()
  12. if hashes.get(h) is not None:
  13. print(fname, hashes.get(h))
  14. continue
  15. else:
  16. hashes[h] = fname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement