"Chris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > def write_data1(out, data): > for i in data: > if i[0] is 'ELEMENT':
Testing for equality with 'is' is a bit of a cheat since it is implementation dependent, but since you have a somewhat unfair constraint .... > out.write("%s %06d " % (i[0], i[1])) Since i[0] is tested to be "ELEMENT', this should be the same as out.write("ELEMENT %06d " % i[1]) which saves constructing a tuple as well as an interpolation. > for j in i[2]: > out.write("%d " % (j)) > out.write("\n") tjr -- http://mail.python.org/mailman/listinfo/python-list