I’m trying to overwrite a directory with another directory that contains the same files.
I’ve tried using distutils.dir_util.copy_tree(src, dst) but it tried to make a directory for dst instead.
The objective is to overwrite the directory and its contents silently.
Is there any other way to do so?
I’m trying to overwrite a directory with another directory that contains the same files.
Share
oops… Turns out that
distutils.dir_util.copy_tree(src, dst)works.It’s just that I got my directory path from environment variables and ‘\n’ was stuck at the back of my path.
Adding in a
.strip()to my path variable solved the problem.