码迷,mamicode.com
首页 > 编程语言 > 详细

Python Note_2

时间:2016-05-23 20:54:44      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

1. file i/o

 

import os,shutil

#print os.getcwd()


sourceRootFolder="D:\Automation\TestSuites\polaris"

count=0
filecount=0

for f in os.listdir(sourceRootFolder):
	tmpdir=os.path.join(sourceRootFolder, f)
	if f.startswith("T"):
		count=count+1
		newpath=os.path.join(tmpdir,"Scenarios")
		print (newpath)
		for sf in os.listdir(newpath):
			if os.path.isfile(os.path.join(newpath,sf))  and sf.endswith(".xml") :
				filecount=filecount+1


print (count," test suites in total")
print (filecount,"test Scenarios in total")

 

Python Note_2

标签:

原文地址:http://www.cnblogs.com/JulieandJulia/p/5521166.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!