首页 > 编程语言 > 详细

Python Note_2

时间:2016-05-23 20:53:18      阅读:189      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!