String concat across multiple source code lines

Janko Hauser jhauser at ifm.uni-kiel.de
Wed Aug 2 16:30:58 EDT 2000


One can use the string.join() method and put these statements into a
list or in a dictionary, if you have standard lines which you can give
a descriptive name.

HTH,
__Janko


Matt <mksql at my-deja.com> writes:

> Is there a better way to do the following?:
> 
> sql = "SELECT * FROM TABLE"
> sql = sql + "WHERE TABLE.COL = VAR"
> sql = sql + "GROUP BY COL2"
> 
> I would prefer a 'cleaner' way of concatinating a single string across
> multiple program code lines. When using a triple quote, any indentation
> in the code gets included.
> 
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

-- 
  Institut fuer Meereskunde             phone: 49-431-597 3989
  Dept. Theoretical Oceanography        fax  : 49-431-565876
  Duesternbrooker Weg 20                email: jhauser at ifm.uni-kiel.de
  24105 Kiel, Germany



More information about the Python-list mailing list