I want to write a code to find all files in subdirectories respectively and then doing one operation for each subdicrectry and then as it goes on..I have came up with below codes but this travers through all files in the directory, but I need to grab all files in particular subdirectory..
for root, dirs, files in os.walk(train_path_healthy):
for filename in files:
if (os.path.splitext(os.path.join(root, filename))[1] == ".png"):
Can someone help me how do that in python?