Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mport glob
- import sys
- sys.stdout = open("/var/www/html/simulations.html", 'w')
- file_folders = []
- # add the simulation files
- file_folders = glob.glob("tmp/*/")
- file_folders += glob.glob("tmp2/*/")
- print("<!DOCTYPE HTML>")
- print"<!-- generated by python script, that's why it's ugly -->"
- print("<html>")
- print("<body>")
- for folder in file_folders:
- print("<p>{}</p>".format(folder))
- images = glob.glob(folder + "*.png")
- print("<p>")
- print("<table>")
- print("<tr>")
- for i in range(1, len(images) / 2 + 1):
- print("<td>{}</td>".format(i))
- print("</tr>")
- images.sort()
- print("<tr>")
- for x in range(1, len(images)/2 + 1):
- print("<td><img src=\"tstuessi/cs420/{}\" style=\"width: 80%; height: 80%\"></td>".format(images[x-1]))
- print("</tr>")
- print("<tr>")
- for i in range(len(images) / 2 + 1, len(images) + 1):
- print("<td>{}</td>".format(i))
- print("</tr>")
- print("<tr>")
- for x in range(len(images)/2 +1 , len(images) +1):
- print("<td><img src=\"tstuessi/cs420/{}\" style=\"width: 80%; height: 80%\"></td>".format(images[x-1]))
- print("</tr>")
- print("</table")
- print("</p>")
- print("</body>")
- print("</html>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement