Jeremy Conlin wrote: > I am trying to copy a folder hierarchy from one location to another. > I can use the shutil.copytree function to copy the folder tree, but I > don't want the files copied, just the folders. What is a good way to > approach this?
The easiest is
def ignore(folder, names):
return set(n for n in names if not
os.path.isdir(os.path.join(folder, n)))
shutil.copytree(source, dest, ignore=ignore)
Peter
--
http://mail.python.org/mailman/listinfo/python-list
