En Mon, 23 Apr 2007 09:29:40 -0300, <[EMAIL PROTECTED]> escribió: > I am working on parsing an xml file using python.How can i > redirect the output to 2 files,say,for some portion of code the output > has to go to one file and for some part the o/p be directed to another > file.
Using two separate files? out1 = open("output1.txt", "w") out2 = open("output2.txt", "w") ... if some_condition: out1.write(...) else: out2.write(...) ... out1.close() out2.close() (If that's not what you want, I may have misundertstood your question, please reformulate it) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list