Avoid newline at the end

Paul Rubin http
Sun Nov 11 13:07:02 EST 2007


Florian Lindner <Florian.Lindner at xgm.de> writes:
>     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]) # <--


def logfile_path(name, row):
    return "/home/%s/%s/log/%s " % (row[1], row[0], name)

logs = '\n'.join(logfile_path(name, row)  
                  for row in resultSet
                  for name in ('access.log', 'error.log'))



More information about the Python-list mailing list