import os,hashlib
def command_shell(file):
with open(file, "rb") as fd:
data = fd.read()
md5sum = hashlib.md5(data).hexdigest()
return md5sum
file_path=r"D:\work\NLP_transfer\split_code\chunk_2.wav"
print(command_shell(file_path))
file_path=r"D:\work\NLP_transfer\split_code\chunk_3.wav"
print(command_shell(file_path))
centos下利用python查看md5和hadoop上文件md5详情见:文章来源:https://www.toymoban.com/news/detail-700387.html
https://blog.csdn.net/weixin_47046791/article/details/131198529?spm=1001.2014.3001.5501文章来源地址https://www.toymoban.com/news/detail-700387.html
到了这里,关于windows下利用python计算文件md5值的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!