title: Python to go through multiple folders and process files inside them
body: <p>I have multiple folders than contain about 5-10 files each. What I am trying to do is go to the next folder when finishing processing files from the previous folders and start working on the new files. I have this code:</p>
  <pre><code>for root, dirs, files in os.walk(&quot;Training Sets&quot;): #Path that contains folders
      for i in dirs: #if I don't have this, an error is shown in line 4 that path needs to be str and not list
          for file in i: #indexing files inside the folders
              path = os.path.join(i, files) #join path of the files
              dataset = pd.read_csv(path, sep='\t', header = None) #reading the files
              trainSet = dataset.values.tolist() #some more code
              editedSet = dataset.values.tolist() #some more code
              #rest of the code...
  </code></pre>
  <p>The problem is that it doesn't do anything. Not even printing if I add prints for debugging.</p>