Reputation: 115
I want to copy a specific folder from one location to another. I want the entire folder to be copied not just the contents of the folder.
I have tried as:
shutil.copytree(src, dst, symlinks=True)
But this copies the content of the folder, not the entire folder.
Upvotes: 1
Views: 72
Reputation: 378
You can just do
shutil.copytree(src, os.path.join(dst, os.path.basename(src)), symlinks=True)
Some might disagree with this approach. but it does exactly what you need here.
Upvotes: 1