I've been trying for days now and searched online for solutions and I only found problems similar to mine which didn't help me. The best I managed so far is to copy the entire structure with all files in it. But I need to copy only .txt and .bmp files.
For my example I have a ChrisO folder and in it a source folder with the subfolders that contain the files. By running the code I need to create the destination folder with the same subfolders and in them all .txt and bmp. files
import os
import shutil
import glob
src= "S:\ChrisO\source"
dest= "S:\ChrisO\destination"
shutil.copytree(src, dest)
I can't currently run the code to try it out, but I think this could work: