首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >python 查找大文件

python 查找大文件

作者头像
用户5760343
发布于 2019-11-21 22:04:32
发布于 2019-11-21 22:04:32
3.4K0
举报
文章被收录于专栏:sktjsktj

import os

root="D:\" def get_FileSize(filePath): try: fsize = os.path.getsize(filePath) fsize = fsize/float(1024*1024) return round(fsize,2) except: return 0 for r,dirs,files in os.walk(root): for file in files: name=os.path.join(r,file) size=get_FileSize(name) if size>500: print(name,size)

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档