import os
import os.path
f=open("Shouldlist.txt")
ShouldList=[]
while 1:
line =f.readline().strip('
')
# print line
if not line:
break
ShouldList.append(line)
# print ShouldList
rootdir="Z:GETOT_BW"
ArriveFile=''
for parent,dirnames,filenames in os.walk(rootdir):
ArriveFile=' '.join(filenames)
# print ArriveFile
ArriveNumber=0
for Item in ShouldList:
if(ArriveFile.find(Item)>0):
ArriveNumber+=1
else:
pass
print ArriveNumber
#print ShouldList[1]
#print ArriveFile[254:274]此段代码主要是检索特定文件夹的全部文件,并对其进行检測,推断是否应到的file到到了。