shutil.copytree()
shutil.copytree() is a Python function in the Shutil Module category. Recursively copies an entire directory tree. The syntax is shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, dirs_exist_ok=False). Parameters: src, dst. Returns: Destination path string. A typical example: shutil.copytree("project/", "backup_project/"). A close sibling is shutil.copy(), which copies a file from src to dst (or into a directory). A close sibling is shutil.copy2(), which like copy() but also preserves metadata (timestamps, permissions). A close sibling is shutil.move(), which moves a file or directory to a new location. A close sibling is shutil.rmtree(), which recursively deletes an entire directory tree (like rm -rf). More about this category: High-level file operations — copy, move, copytree, rmtree, make_archive. For a broader walkthrough, read the Shutil Module guide. Related Shutil Module entries: shutil.copy(), shutil.copy2(), shutil.move(), shutil.rmtree(), shutil.make_archive(), shutil.get_archive_formats(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details.