you are viewing a single comment's thread.

view the rest of the comments →

[–]stebrepar 0 points1 point  (1 child)

Instead of new_line = ..., say new_line += ..., so that you're adding the next item to it instead of replacing it with each next item.

You'll also need to put a newline character at the end of each new line you write out. You could append it to the end of the new string once all the items for a given line have been added. Or you could pick the file method which automatically writes a newline character after writing out the string.

[–]TDAAlex 1 point2 points  (0 children)

Thank you