I\'m trying use shutil.copytree:
shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=None)
This copy also files in folder. I need copy only folders
use distutils.dir_util.create_tree to just copy directory structure (not files)
note : the argument files
is a list of filenames. if you want something that would work as shutils.copytree:
import os
import distutils.dir_util
def copy_tree(source, dest, **kwargs):
filenames = [os.path.join(path, file_) for path, _, files in os.walk(source) for file_ in files]
distutils.dir_util.create_tree(dest, filenames, **kwargs)