Copyfile function

Hi, I cannot use this function correctly.

copyfile(train_images, TRAINING_DIR)

I receive the error below

You are providing the parameters as a list which is incorrect. Here’s a hint from copyfile: src and dst are path-like objects or path names given as strings.

Hi bakaji, I have changed to path-like objects. But it is still incorrect

  for j in range(len(train_images)):
    path = os.path.join(SOURCE_DIR, train_images[j])
    copyfile(path, TRAINING_DIR)

The trace says that the destination is a directory. Destination should be a file.

Thanks! I solve this problem