"Damon Timm" <[EMAIL PROTECTED]> wrote

walk the directory path, I want to see if a directory contains any
files ending in a certain type ... if it does, I wanna do some stuff

Check out the glob module.

for dirpath, subFolders, files in os.walk(rootDir):
    try:
        i = files.index("*.flac") #how do I make it search for files
that end in ".flac" ?

If yu call glob.glob() with the dirpath you will get a list of all
the flac files in the current dir.

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to