How to write a call back function for ignore in shutil.copytree
问题 I am relatively new to python. I am trying to copy a directory to another directory maintaining the structure. I am using shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False) I am trying to write a call back function for ignore. My aim is to take a list of files in a list , and copy only those files,ignoring the rest. How do we pass a list into the call back function? I wrote a simple call back function , but I get some error when I try