copy_these = ['a.txt', 'b.txt', 'c.txt']

def ignore_most(folder, files):
    ignore_list = []
for file in files:
    full_path = os.path.join(folder, file)
if not os.path.isdir(full_path):
    if file not in copy_these:
        ignore_list.append(file)
return ignore_list
How to write a call back function for ignore in shutil.copytree