Skip to main content

Posts

Showing posts from September, 2016

Simple python script for creating an image listing in HTML

Just a code snippet without any adieu... #!/usr/bin/python import sys, os foldername = sys.argv[1] file_list = os.listdir(foldername) file_list.sort() output = "<html><body>" for file in file_list: output += "<img width='100%' src='" + foldername + os.path.sep + file + "'></img>" print output Simply redirect the output to a file with a .html extension and open the html file in browser.