Avoid newline at the end

Florian Lindner Florian.Lindner at xgm.de
Sun Nov 11 05:22:19 EST 2007


Hello,
I have a piece of code like that:

    for row in resultSet:
        logs += "/home/%s/%s/log/access.log \n" % (row[1], row[0])
        logs += "/home/%s/%s/log/error.log \n" % (row[1], row[0]) # <--

Now I want to avoid the newline at the last iteration and only at the second
line.
How to do that most elegantly with Python?

Thanks,

Florian



More information about the Python-list mailing list