我使用了上述链接中的一个示例,但通过删除对函数的调用(最初来自上面)对其进行了一些小改动:
import hashlib
hash = hashlib.md5()
with open('validFilePath/file.xxx', "r+b") as f:
for block in iter(lambda: f.read(65536), ""):
hash.update(block)
return hash.hexdigest()
这给了我以下错误。
File "<string>", line 4, in <module>
TypeError: 'function' object is not iterable
我错过了一些基本的 Python 前提吗?