首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >python 获取文件md5值脚本

python 获取文件md5值脚本

作者头像
用户5760343
发布2022-05-14 13:02:15
发布2022-05-14 13:02:15
2.1K0
举报
文章被收录于专栏:sktjsktj

!/usr/bin/python

import hashlib import os def md5(file_path): if os.path.isdir(file_path): return '1' read_file = open(file_path,'r') the_hash = hashlib.md5() for line in read_file.readlines(): the_hash.update(line.encode('utf8')) read_file.close() return the_hash.hexdigest()

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-05-13,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • !/usr/bin/python
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档