Just a code snippet without any adieu...
Simply redirect the output to a file with a .html extension and open the html file in browser.
#!/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.
Comments
Post a Comment