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.
Here's what I mean:
import os, syspath = "path/to/dir"dirs = os.listdir(path)for file in dirs: if file == '*.csv': print file
I know there is no wildcard variable in python, but is there a way of doing this?