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 += '