images = [] # ... Fill the images ... def get_name(image): # Get the name of the image (stripping the # file extension) # name = TODO return name # Then for every image, create its own Web page... for (i, image) in enumerate(images): name = get_name(image) f = open('page-%s.html', 'w') f.write('''\

%(name)s


''' % {'name': name, 'image': image}) # Add links for the previous page, the next # page, and the home page. def add_link(number): name = get_name(images[number]) f.write('%s
' % \ (num, name) ) if i > 0: add_link(i - 1) if i < len(image) - 1: add_link(i + 1) f.write('''\ ''') f.close() # And finally create a home page to list every image. f = open('index.html', 'w') # TODO: write the list of the images f.close()