How do I copy an entire directory of files into an existing directory using Python?

Here’s a solution that’s part of the standard library:

from distutils.dir_util import copy_tree
copy_tree("/a/b/c", "/x/y/z")

See this similar question.

Copy directory contents into a directory with python

  • Reference – https://docs.python.org/3/distutils/apiref.html#distutils.dir_util.copy_tree

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)