计算文件数量
上一篇 /
下一篇 2012-11-19 10:37:39
/ 个人分类:python
# -*- coding: GBK -*-
import os;
#计算doc#
NUM = 0
def subFileChmod(_sPath):
global NUM;
itemsInDir = os.listdir(_sPath);
for item in itemsInDir:
sItemPath = os.path.join(_sPath,item);
if os.path.isdir(sItemPath):
if item == ".svn":
print "svn"
else:
print "num 计算中= " + str(NUM)
subFileChmod(sItemPath);
else:
print sItemPath
NUM = NUM + 1
print "文件数为:" + str(NUM)
_sPath = "E:\";
subFileChmod(_sPath)
print "********************************"
print "文件总数为:" + str(NUM)
收藏
举报
TAG: