#### Using fnmatch to get the file list under specific folder
import fnmatch
import os
print "All the files under the foler ------------"
print os.listdir("D:\\learned SQLs in progress")
print "all the sql files"
for file in os.listdir("D:\\learned SQLs in progress"): # read folder deep down to files leavel
if fnmatch.fnmatch(file, "*.sql"): # pick the files meet the condition
print file