import os import os.path def makeGallery(path): myFile = "galleryyy.html" theFile = open(path + os.sep + myFile, "wt") theFile.write(pixList(path)) theFile.close() def pixList(path): files = os.listdir(path) lines = "" + "\n" for f in files: if f.endswith(".jpg") or f.endswith(".JPG"): line = '' line += '' line += '' lines += line + "\n" return lines + "" # question. What would we need to do to make this thing recursively # go into subfolders???