本文实例讲述了Python简单计算文件MD5值的方法。分享给大家供大家参考,具体如下:
一 代码
import sys import hashlib import os.path filename = sys.argv[1] if os.path.isfile(filename): fp=open(filename,'rb') contents=fp.read() fp.close() print(hashlib.md5(contents).hexdigest()) else: print('file not exists')
查看更多关于Python简单计算文件MD5值的方法示例的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did84141