lets say I have a list like so:
[\'one\',\'two\',\'three\',\'four\',\'five\',\'six\',\'seven\',\'eight\',\'nine\']
and I want to experiment
Well there are several templating libraries around (Genshi is one I like but there are many others).
Alternatively you could do something like:
def print_table(data, row_length):
print ''
counter = 0
for element in data:
if counter % row_length == 0:
print ''
print '%s ' % element
counter += 1
if counter % row_length == 0:
print ' '
if counter % row_length != 0:
for i in range(0, row_length - counter % row_length):
print ' '
print ''
print '
'