Alan Gauld wrote: > a = len(os.listdir(mydir, '*JPG') > > Should be about right... No, os.listdir() only takes one argument, the directory. See the solutions with glob.glob(). Kent