I have a directory which contains multiple directories within it. The sub directories each have jpeg images in them. Can you help me to find a way to extract those images and copy them to a single folder using python.
Thanks in advance
I have a directory which contains multiple directories within it. The sub directories each have jpeg images in them. Can you help me to find a way to extract those images and copy them to a single folder using python.
Thanks in advance
you could do for example :
import glob, os
from shutil import copyfile
os.chdir("yourdirectory")
for file in glob.glob("*.jpeg"):
copyfile(file, "destinationdirectory/"+file)