for root,dirs,files in os.walk(payloadPath):
for tempFile in files:
path = os.path.join(root,tempFile)
# print "文件路径 =" +path
with open(path,"rb") as file:
for line in file:
if (line.find("xxxx")>0):
print "******存在******"
#写日志
filePath = path+"\n"
fileList.append(filePath)
break
复制代码
Python 循环遍历文件夹
最新推荐文章于 2024-05-02 07:35:31 发布