def cut(path):
test = str(foundfiles)
newList = [s for s in test if test.endswith('.UnitTests.vbproj')]
for m in newList:
print m
return newList
这个函数解析foundliles,foundliles是一个文件夹中的文件列表,我已经分析了大约20多个文件。我需要分析一下每一个文件的列表。单元测试.vbproj“但是,我不能让它工作。任何建议都将不胜感激!在
编辑1:这就是我现在编写代码的地方,我得到一个属性错误消息框,说明“tuple”对象没有属性“endswith”
^{pr2}$
我真的不知道你的“基金档案”是什么类型的。 也许这样可以帮助你:
你把列表变成了一个字符串。在
test
上循环会给您单独的字符:不需要将
^{pr2}$foundfiles
转换为字符串。您还需要测试列表的元素,而不是test
:相关问题 更多 >
编程相关推荐