fheroes3/test-html.py

14 lines
405 B
Python
Raw Normal View History

2014-06-21 12:41:07 +00:00
file = open("test2")
objects = [[] for i in range(255)]
for line in file:
objclass, obj = line.split()
objects[int(objclass)].append(obj)
file = open("test.html", "w")
for i, objs in enumerate(objects):
if len(objs) == 0:
continue
file.write("<h1>class %d</h1>\n"%i)
for obj in objs:
file.write("<img src=\"data/advmap_objects/%s/0.png\" title=\"%s\"/>\n"%(obj, obj))