Request for comments: Search and replace script

Fernando Pérez fperez528 at yahoo.com
Fri Feb 22 15:11:43 EST 2002


VanL wrote:

> 
> > please try to keep a line down to 78 chars
> 
> Fixed, at least for most of the code.  I don't know how to deal with
> long strings, tho:
> For example, self.writeLog('This is a very long line that has this %s
> substitution and will go longer than 78 chars")
> 
use

        self.writeLog('This is a very long line that has this %s'
                      ' substitution and will go longer than 78 chars")

contiguous strings are concatenated.

or for really long stuff, use 

        self.writeLog(
"""This is a very long line that has this %s
This is a very long line that has this %sThis is a very long line that has 
this %sThis is a very long line that has this %sThis is a very long line that 
has this %sThis is a very long line that has this %sThis is a very long line 
that has this %s                      ' substitution and will go longer than 
78 chars"""
)

cheers,

f



More information about the Python-list mailing list