I want to copy all the pictures from one folder to another folder. I tried to run this code again and again but it returns me False only instead of saving pictures to other folder.
import cv2
import glob
input_path = 'C:\\Users\\Kazmi-PC\\OneDrive\\Pictures\\1\\*.*'
output_path = 'C:\\Users\\Kazmi-PC\\OneDrive\\Pictures\\2\\*.jpg'
for file in glob.glob(input_path):
print("printing.....")
print(file)
a= cv2.imread(file)
cv2.imwrite(output_path, a)
*in output. You have to runimwriteinside for loop. And you have to use real, unique name for every file.shutil.copy(input_name, output_name)but you still have to copy every file separatelly. But you can use directory as output and then it will use filename from input.