title: how to print folder name in python?
body: <p>I am trying to read multiple folders for a specific text file using <code>glob.glob</code> to search in all folders. I wanted to print only the folder name instead of folder name/file.txt.</p>
  <pre><code>with open ('input.txt', 'w') as i:
      for files in glob.glob ('*/*.txt'):
          print (files)
  </code></pre>
  <p>I want my output to be like</p>
  <pre><code>folder1
  folder2
  folder3
  </code></pre>
  <p>instead of</p>
  <pre><code>folder1/file.txt
  folder2/file2.txt
  </code></pre>
  <p>I saw many posts where they used os.path....which I did understand clearly</p>