list of the contents of the directory
os.listdir("c:\\music\\_singles\\") #listdir returns both files and folders, with no indication of which is which.
separate the files from the folder
[f for f in os.listdir(dirname)
if os.path.isfile(os.path.join(dirname, f))]
get a list of the subdirectories within a directory
[f for f in os.listdir(dirname)
if os.path.isdir(os.path.join(dirname, f))]
list the full path of all files and directories matching the wildcard
import glob
glob.glob('c:\\music\\_singles\\s*.mp3') # list the files in a specific directory that start with "s" and end with ".mp3"
Reference: http://www.diveintopython.net/file_handling/os_module.html