程序猿刚子的博客

大龄程序猿,分享互联网开发相关知识!前端、后端,架构等内容,欢迎关注公众号 chengxuyuangangzi

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年8月10日

摘要: 代码:import osimport sysdef showsmallfiles(dir): v=os.listdir(dir) for i in v: d="%s/%s"% (dir,i) if os.path.isdir(d): showsmallfiles(d) else: if os.path.getsize(d) < int(sys.argv[2]): logger(d)#logfiledef logger(text): f=open('d:/python/log.txt','a') f.write(text+'\r\ 阅读全文
posted @ 2011-08-10 11:51 程序猿刚子 阅读(258) 评论(1) 推荐(0) 编辑