标签:def 一个 self 排序 dir mat pat port report
reportPath =文件夹路径
listdir=以一个list返回文件夹下所以文件
dirs = os.listdir(reportPath)
print(dirs)
def __get_report(self):
"""获取最新测试报告"""
dirs = os.listdir(reportPath)
# print(dirs)
dirs.sort() #列表排序
newreportname = dirs[-1]
print(‘The new report name: {0}‘.format(newreportname))
return newreportname
标签:def 一个 self 排序 dir mat pat port report
原文地址:https://www.cnblogs.com/mahaining/p/9902992.html