I'm new to python and want to code for specific characteristics in folders and then perform operations on the contents within the desired folder. This is an example below:
Path = "./Desktop/Example/"          #Input Directory
A_files = []                                                                    
for dirName, subdirList, fileList in os.walk(Path):                            
    for filename in fileList:                                                       
        if "[A]" in subdirList()
        if ".txt" in filename.lower():                                                  
            A_files.append(os.path.join(dirName,filename)) 
#Perform Mathematical Operators for A_files only
B_files = []                                                                    
for dirName, subdirList, fileList in os.walk(Path):                            
    for filename in fileList:                                                       
        if "[B]" in subdirList()
        if ".txt" in filename.lower():                                                  
            B_files.append(os.path.join(dirName,filename))
 #Perform Mathematical Operators for B_files only
 #Perform Mathematical Operators between A_files and B_files together
In folder "Example" are sub folders: Hello_World[A] and Hello_World[B] and I want to access all .txt files in each folder individually at first to perform a scaling of the values. Later I do other mathematical operators between the two files.
Thank you for you help!
 
     
    