title: Python Glob - Get Full Filenames, but no directory-only names
body: <p>This code works, but it's returning directory names and filenames. I haven't found a parameter that tells it to return only files or only directories.
  Can glob.glob do this, or do I have to call os.something to test if I have a directory or file.  In my case, my files all end with .csv, but I would like to know for more general knowledge as well.</p>
  <p>In the loop, I'm reading each file, so currently bombing when it tries to open a directory name as a filename.</p>
  <pre><code>files = sorted(glob.glob(input_watch_directory + &quot;/**&quot;, recursive=True))
  for loop_full_filename in files:
      print(loop_full_filename)
  </code></pre>
  <p>Results:</p>
  <pre><code>c:\Demo\WatchDir\
  c:\Demo\WatchDir\2202
  c:\Demo\WatchDir\2202\07
  c:\Demo\WatchDir\2202\07\01
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_51.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_52.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_53.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_54.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_55.csv
  c:\Demo\WatchDir\2202\07\05
  c:\Demo\WatchDir\2202\07\05\polygonData_2022_07_05__12_00.csv
  c:\Demo\WatchDir\2202\07\05\polygonData_2022_07_05__12_01.csv
  </code></pre>
  <p>Results needed:</p>
  <pre><code>c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_51.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_52.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_53.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_54.csv
  c:\Demo\WatchDir\2202\07\01\polygonData_2022_07_01__15_55.csv
  c:\Demo\WatchDir\2202\07\05\polygonData_2022_07_05__12_00.csv
  c:\Demo\WatchDir\2202\07\05\polygonData_2022_07_05__12_01.csv
  </code></pre>
  <p>For this specific program, I can just check if the file name contains.csv, but I would like to know in general for future reference.</p>