Is it possible to break a string literal into multiple lines?

Zeynel azeynel1 at gmail.com
Sat Nov 13 13:53:56 EST 2010


I have string formatting line in Google App Engine webframe webapp:

self.response.out.write("<b>%s</b>: <br /> mWEIGHT: %s <br />
mDATE0_integer: %s <br /> mCOUNT: %s <br />" % (result.mUNIQUE,
result.mWEIGHT, mDATE0_integer, result.mCOUNT,))

I would like to be able to write it as

self.response.out.write("<b>%s</b>: <br />
                                  mWEIGHT: %s <br />
                                  mDATE0_integer: %s <br />
                                 mCOUNT: %s <br />"
                                                            %
(result.mUNIQUE,
 
result.mWEIGHT,
 
mDATE0_integer,
 
result.mCOUNT,))

But neither \ or enclosing the string in parens let me break the
string literal enclosed in "" Is this possible?



More information about the Python-list mailing list