concatenating lists via dtml
Hello! How do you concatenate lists (or add a new listelement) to list-properties? Regards, Ingo.
try <dtml-call "list.append('whatever')"> peter. On Tue, 7 Mar 2000, Ingo Assenmacher wrote: :Hello! : :How do you concatenate lists (or add a new listelement) to :list-properties? : :Regards, Ingo. -- _________________________________________________ peter sabaini, mailto: sabaini@niil.at -------------------------------------------------
Ingo Assenmacher wrote:
Hello!
How do you concatenate lists (or add a new listelement) to list-properties?
<dtml-call "mylist.append(element)"> <dtml-call "mylist.extend(another_list)"> in general, fire up python interpreter and explore : [hannu@hu hannu]$ python Python 1.5.2 (#1, Apr 18 1999, 16:03:16) [GCC pgcc-2.91.60 19981201 (egcs-1.1.1 on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
dir([]) ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'] l = [9] l.extend([1,2,3]) l [9, 1, 2, 3] l.append([1,2,3]) l [9, 1, 2, 3, [1, 2, 3]]
------------- Hannu
participants (3)
-
Hannu Krosing -
Ingo Assenmacher -
Peter Sabaini