Copy directory contents into a directory with python [duplicate]
I found this code working which is part of the standard library:
from distutils.dir_util import copy_tree# copy subdirectory examplefromDirectory = "/a/b/c"toDirectory = "/x/y/z"copy_tree(fromDirectory, toDirectory)
Reference:
You can also use glob2 to recursively collect all paths (using ** subfolders wildcard) and then use shutil.copyfile, saving the paths
glob2 link: https://code.activestate.com/pypm/glob2/