title: Loop through all CSV files in a folder
body: <p>I'm trying to loop through only the csv files in a folder that contains many kinds of files and many folders, I just want it to list all of the .csv files in this folder.</p>
  
  <p>Here's what I mean:</p>
  
  <pre><code>import os, sys
  
  path = "path/to/dir"
  dirs = os.listdir(path)
  
  for file in dirs:
      if file == '*.csv':
          print file
  </code></pre>
  
  <p>I know there is no wildcard variable in python, but is there a way of doing this?</p>