Copy

'''py from tqdm import tqdm import pandas as pd import os import shutil files = ["file1.txt", "file2.txt", "file3.txt"] def copy_file(files): print('Copying files from A to B') for fname in tqdm(files): outfile = fname.replace("/home/file/position/", "/home/second/position") if not os.path.exists(outfile[:-5]): os.makedirs(outfile[:-5]) #if the directory does not exist, make the directory shutil.copyfile(fname, outfile) a = copy_file(files) '''