I am trying to find all the .c files in a directory using Python.
.c
I wrote this, but it is just returning me all files - not just .c files.
for _,_,filenames in os.walk(folder): for file in filenames: fileExt=os.path.splitext(file)[-1] if fileExt == '.c': results.append(file)