def ignore_list(path, files):
filesToIgnore = []
allowedExtensionList = ['pyc', 'ui', 'txt']
fileNameList = ['__main__.py', 'myfile.bat']
for fileName in files:
fullFileName = os.path.join(os.path.normpath(path), fileName)
fName, fileExtension = os.path.splitext(os.path.basename(fullFileName))
if fName not in fileNameList or fileExtension not in allowedExtensionList:
filesToIgnore.append(fileName)
return filesToIgnore
start of script
shutil.copytree(srcDir, dstDir, ignore=ignore_list)
This code has produced empty folder. I don't know why the folder is empty, how can i correct this ?