I have a folder (A) that is structured like this:
A\b
A\c
A\d
I would like to copy folder b, c, and d one level down 3 times like this:
A\b\b1\b2\b3
A\c\c1\c2\c3
A\d\d1\d2\d3
Where b1,b2, and b3 are copies of the folder b, the same goes for c and d.
When I run the code below I end up with the desired structure but also adds three copies in each sub-folder so A\b\b1 has b1,b2, and b3 folders. The problem has to do with the loop but I can't pinpoint it
import os
import sys
import shutil
list1= [1,2,3]
path = "C:\ladg\oner"
root, dirs, files = os.walk(path).next()
for dir in dirs:
for i in list1:
new_folder_path = os.path.join(root,dir, dir+ str(i))
shutil.copytree(os.path.join(root, dir), new_folder_path)