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
この関数は、約 20 以上のファイルを既に解析したフォルダー内のファイルのリストであるfoundliles を解析します。「.UnitTests.vbproj」で終わるすべてのファイルのリストを解析する必要がありますが、うまくいきません。どんなアドバイスでも大歓迎です!
Edit1:これは私が今コードを作成したもので、「tuple」オブジェクトには属性「endswith」がないという属性エラーメッセージボックスが表示されます
def cut(path):
test = foundfiles
newList = [s for s in foundfiles if s.endswith('.UnitTests.vbproj')]
for m in newList:
print m
return newList