pathList = []
try:
report = open(txtPath,'r')
except Exception,ex:
print str(Exception),':',str(ex)
report.close()
return pathList
for line in report:
if len(line) <= len('\n'):
continue
#line = line.decode('cp936')
pathList.append(line[:-1])#去掉开头的\t和最后的\n
report.close()
pathList.sort()
return pathList
if '__main__' == __name__:
for item in g_ResultTxtName:
txtPath = os.path.join(WORKDIR, item)
pathList = []
if os.path.exists(txtPath):
pathList = analyseReport(txtPath)
for Path in pathList:
docPath = os.path.join(CasePath, Path)
deleteFile(docPath)
print 'Delete Over'
os.system("pause")
文章来源于领测软件测试网 https://www.ltesting.net/