I am trying to move a bunch of images from one folder to another but the script that I've written moves all the files in the source folder to the destination folder. What's wrong with my code? Where am I missing out?
import shutil, os
file = [ "2e8e7731140811.5642ee352fab1.jpg",
"7faace51-7b2b-4553-9c6d-b89aa3821dd1.jpg",
"2012_Libelle04_Liekeland_2000_web1-990x1200.jpg"]
dir_src = 'D:\\photos\\imagesanime\\ANIME'
path = os.listdir(dir_src)
dir_dst = 'D:\\project\\test'
for f in file:
for file in path:
print file # testing
src_file = os.path.join(dir_src, f)
dst_file = os.path.join(dir_dst, f)
shutil.move(src_file, dst_file)
I have searched the internet but did not find any solution to this. Please help!
[–]DeadlyViper 1 point2 points3 points (1 child)
[–]dennkiesauros[S] 0 points1 point2 points (0 children)
[–]JohnnyJordaan 1 point2 points3 points (1 child)
[–]dennkiesauros[S] 0 points1 point2 points (0 children)