[ZPT] Question about controlling repeat loops
Peter C. Norton
spacey-zope@lenin.nu
Sun, 11 Aug 2002 20:32:21 -0700
[sorry about the messed up subject line before]
Is there a way to make a loop structure using templates to do roughly
the following in python:
>>> loop = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> i = 0
>>> while i < len(loop):
... print loop[i]
... i = i+1
... print ("Yeah and one %d" % loop[i])
... i = i + 1
...
I'm asking because I've got a folder with images in it, and I'd like
for those images to be put into a table that's 3 colums wide. I can't
see a way to increment the list in a "repeat" clause to do the above.
What's the right way to approach this sort of thing?
--
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.