python获取路径下所有图片:

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jacke121/article/details/82788304

  images_path=[]
    for root, dirs, files in os.walk(config["images_path"]):  # 遍历统计

       if "asdfsdf" in root:
            for tfile in files:
                if tfile.endswith(".jpg"):
                     images_path.append(tfile)

猜你喜欢

转载自blog.csdn.net/jacke121/article/details/82788304