strings in Python (newbie)
zf_acs at DELETETHIShotmail.com
Fri Mar 14 13:18:21 CET 2003
Alex Martelli <aleax at aleax.it> wrote in message
news:7Xica.56121$pG1.1289243 at news1.tin.it...
> zif wrote:
> > Thanks, I'll try that as well. Another question: how
> > can I break long text/array elements across multiple
> > lines?
> If I'm reading your question correctly, the answer is
> easy -- Python concatenates multiple adjacent "physical"
> lines into a single "logical" line as long as an open
> parens (or bracket) hasn't yet been closed. So for ex:
> longstuff = [ 0, 1, 45, 67, 223, 23,
> 15, 43, 88, 99, 1, 0,
> 23, 24, 42, 15, 0, 2 ]
> just works. Note that indentation is arbitrary for all
> the physical lines except the first one (also known as
> "continuation lines") -- the one I'm showing here is just
> one reasonably popular convention (there are others, too).
More information about the Python-list