On Monday 09 May 2016 09:10, DFS wrote:

> sSQL =  "line 1\n"
> sSQL += "line 2\n"
> sSQL += "line 3"

Pointlessly provocative subject line edited.

Since all three lines are constants know by the programmer at the time the 
source code is written, it should be written as:


sSQL = """line 1
line 2
line 3"""

Or if you prefer:

sSQL = "line 1\nline 2\nline 3"


Or even:

sSQL = ("line 1\n"
        "line 2\n"
        "line 3")

taking advantage of Python's compile-time implicit concatenation of string 
constants.



-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to