Python Forum

Full Version: Copy files from subfolders into same name of subfolders at other directory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I need python script, which should be capable for copying files from different subfolders into new directory and this new directory should contain same subfolders. I am unable to create this sub_folders at destination during run time.
can anybody help me.

for example :
source_folder:
sub_folder1:
test1.txt
image1.jpg
sub_folder2:
test2.txt
image2.jpg
sub_folder3:
test3.txt
image3.jpg


destination_folder:
sub_folder1:
test1.txt
sub_folder1:
image1.jpg
sub_folder2:
test2.txt
sub_folder2:
image2.jpg
sub_folder3:
test3.txt
sub_folder3:
image3.jpg
Please show what you  have tried so far, and where you are running into problems.