kewlclassic
asked on
how to copy files from different sources to different destinations using phyton?
Hi
I need to copy a file from a source folder to two different destination folders.
I tried this but not working
import os
import shutil
src = 'E:/source/node2/'
dst1 = 'e:/destination1'
dst2 = 'e:/destination2'
filename='file.xml'
shutil.copy(os.path.join(s rc, filename), dst1, dst2)
Please advice?
Kewclassic
I need to copy a file from a source folder to two different destination folders.
I tried this but not working
import os
import shutil
src = 'E:/source/node2/'
dst1 = 'e:/destination1'
dst2 = 'e:/destination2'
filename='file.xml'
shutil.copy(os.path.join(s
Please advice?
Kewclassic
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@kewlclassic: Just write what was the problem and then accept your own answer. This is a good way to close the question.
ASKER
I got it working
os.system('cp -rf %s %s' % (src, dst1));
os.system('cp -rf %s %s' % (src, dst2));
If your computer is not command 'cp', you can try install mingw to do this.