#!/usr/bin/python
#-*- coding:UTF-8 -*-
from hashlib import md5
def getFileMd5(path):
try:
f = open(path,'rb')
m = md5()
m.update(f.read())
f.close()
return m.hexdigest()
except Exception,e:
print e
if __name__ == '__main__':
APK_PATH = raw_input('please input filepath--->')
print getFileMd5(APK_PATH)
Python个人代码库:得到文件的md5值
最新推荐文章于 2022-10-27 11:42:03 发布