import shutil import os os.chdir('source_image_dir_path') dst_dir = "your_destination_dir_path" for f in os.listdir(): shutil.copy(f, dst_dir)
Here is what the above code is Doing:
1. Change the current working directory to the source directory.
2. Create a destination directory.
3. Loop through all the files in the source directory.
4. Copy each file to the destination directory.