扫描目录下的所有文件并返回文件的绝对路径

 

def fileListFunc(filePathList):
    fileList = []
    for filePath in filePathList:
        for top, dirs, nondirs in os.walk(filePath):
            for item in nondirs:
                fileList.append(os.path.join(top, item))
    return fileList

 

相关文章:

  • 2021-11-19
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2022-01-07
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
相关资源
相似解决方案