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("
class %d
\n"%i)
for obj in objs:
file.write("\n"%(obj, obj))