There is a repository with folders and images inside these folders. The point is that I cant figure out how this method os.remove works. In some folders it removes unneeded files , in some doesn't, also some folders is shrinking in sizes ( 10-15 images ), some isn't. What am I missing here?
dirs = next(os.walk(path))[1]
for d in dirs:
dirPath = path + d
os.chdir(dirPath)
dirPath = path + d
files = next(os.walk(dirPath))[2]
for f in files:
if f is 'feature.bin': os.remove('feature.bin')
if f is 'filelist_LBP.txt': os.remove('filelist_LBP.txt')
if f is 'info.txt': os.remove('info.txt')