Sorry, I forgot to paste the modified version of my code in the post:. I think this is the same behaviour:
for line in lines: if "placed" in line: if "i_a/i_b/ROM/" in line: pos = (line.split()[4]).split("_")[1] found = False for (tag, (start, end)) in tags: if tag in line: found = True print " i_a/i_b/ROM/%s [%i:%i] LOC =" %\ (pos, tag, start, end) break if not found: print "Error" -- http://mail.python.org/mailman/listinfo/python-list