开发者

Iterate through every .jpg or .jpeg file in directory and sub directory

开发者 https://www.devze.com 2023-03-14 11:00 出处:网络
I want to iterate through every jpg/jpeg file in a directory and every subdirectory and every subdirectory of that sub-directory and so on. I want to be able to go through every single image开发者_运维

I want to iterate through every jpg/jpeg file in a directory and every subdirectory and every subdirectory of that sub-directory and so on. I want to be able to go through every single image开发者_运维问答 file in a folder. Is there an easy way to do this or would a recursive method work best?


Dir.glob("your_directory/**/*.{jpg,jpeg}")
0

精彩评论

暂无评论...
验证码 换一张
取 消