模板12345import hashlibwith open(path, "rb") as f: bytes = f.read() md5 = hashlib.md5(bytes).hexdigest()