이미지를 가지고 있는 폴더도 소스리스트에 추가할 수 있게 함.

This commit is contained in:
2024-11-29 03:12:38 +09:00
parent bae6a8add3
commit c0998d0289
2 changed files with 52 additions and 30 deletions

View File

@@ -80,14 +80,18 @@ def ListContainFiles(pathDir):
return listRet
def ListFileExtRcr(pathTrg, strExt):
def ListFileExtRcr(pathTrg, listExt):
listRet= []
if False == isinstance(listExt, list):
print("ext must list")
return
# pathTrg의 하위 디렉토리 및 파일 목록을 얻음
for dirpath, dirnames, filenames in os.walk(pathTrg):
for file in filenames:
extTmp = GetExtStr(file, False)
if extTmp.lower() == strExt and file.startswith('.'):
extTmp = GetExtStr(file)
if extTmp.lower() in listExt and not file.startswith('.'):
listRet.append(os.path.join(dirpath, file))
return listRet