title: Crawl through all folders and files in a directory
body: <p>I have a directory structures as follows:</p>
  
  <pre><code>.
  ├── 0_0_a_example
  │   ├── ab.csv
  │   └── cd.csv
  ├── 0_1_b_example
  │   ├── ab.csv
  │   └── cd.csv
  ├── 1_0_c_example
  │   ├── ab.csv
  │   └── cd.csv
  └── 1_1_d_example
      ├── ab.csv
      └── cd.csv
  </code></pre>
  
  <p>I want to write a Python script to plot a 2x2 graph with each first file in each subdirectory (then each second file).</p>
  
  <p>I intentionally named each subdirectory beginning with <code>ixj</code> so it makes it easier to iterate (I don't care about the rest of the name). I'm looking at other answers that use <code>glob</code> and <code>os</code>, but the solutions I found are to read the files directly, not subdirectories and files.</p>
  
  <pre class="lang-py prettyprint-override"><code>import glob
  
  for i in range(2):
      for j in range(2):
          subdir = glob.glob(f'{i}_{j}_*')
          print(subdir)
          file = os.listdir(subdir[0])[0]
          print(file)
  </code></pre>
  
  <p>Is there an easier way to do this? (or a more Pyhtonic way to do this)</p>
  
  <p>Also, my solution sometimes prints the file <code>cd.csv</code> as first index.</p>