On 13/11/2010 18:53, Zeynel wrote:
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?

Use triple-quoted strings:

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,))
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to