Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
with open("outputfilepath", 'w') as fp:
    for line in iterable: #assuming line is str with \n
        print >> fp, line
#implicit fp.close() here as "with" scope ends.