i'm trying to copy files from one folder to another, so i've start by creating the 2 folder and subfolder but the problem occured when i tried to copy file using shutil.copyfile(), the problem is when i run this code one slash(/) is added tho the end of my folder path. find down my code.
original = 'Users\\Jonathan\\Documents\\datas'
base_direct = 'Users\\Jonathan\\Documents\\dataset'
os.mkdir(base_direct)
train_dir = os.path.join(base_direct, 'train')
os.mkdir(train_dir)
train_cats_dir = os.path.join(train_dir, 'cats')
os.mkdir(train_cats_dir)
fnames = ['cat.{}.jpg'.format(i) for i in range(1000)]
for fname in fnames:
src = os.path.join(original, fname)
dst = os.path.join(train_cats_dir, fname)
shutil.copyfile(src, dst)
so the error is saying:
FileNotFoundError: [Errno 2] No such file or directory: 'Users\\Jonathan\\Documents\\datas/cat.0.jpg'
the problem is on the slash between datas and cat
i'm using google colab.