import os
import shutil
path="./images";
p=os.walk(path);
real_file=[];
for root,dirs,file in p:
for f in file:
if f.split("_")[1]=="real" and f.split(".")[0].split("_")[-1]=="A":
real_file.append(f);
print(real_file);
new_path="real_path";
if not os.path.exists(new_path):
os.mkdir(path);
for f in real_file:
src_path=path+"/"+f;
dst_path=new_path+"/"+f;
# print(src_path);
shutil.copy(src_path,dst_path);
print("finished");