In an arrangement I save the entire format of a table that I am placing in a PDF, I do it within a for .
At the next round he places the first and the second, when he only has to place the second because it is the second round.
How can I remove the contents of an ALL array so it cleans up?
for vuelta in range(mes,13):
tabla_formateada = []
vuelta=1
for item in tabla_encabezado:
tabla_formateada.append(Paragraph("<font size=%s><b>%s</b></font>" % (6, item),
rep.styles_reporte()['center']))
vuelta=vuelta + 1
if vuelta > 4:
tabla_formateada.append(Paragraph("<font size=%s><b>%s</b></font>" % (6, '%'),
rep.styles_reporte()['center']))
tabla1 = [tabla_formateada]
ano_inicio = int(ano_inicio) + 1
'''se les da el tamaño a cada una de las columnas'''
table = Table(tabla1, colWidths=tamano,
repeatRows=1)
'''se le agrega el estilo ala tabla'''
table.setStyle([('VALIGN', (0, 0), (-1, -1), 'TOP'),
('BOX', (0, 0), (-1, -1), 0.30, colors.black),
('BACKGROUND', (0, 0), (-1, 0),
colors.HexColor('#DFDFDF')),
('INNERGRID', (0, 0), (-1, -1), 0.25,
colors.black)])
story.append(table)
story.append(Spacer(1, 10 * mm))
doc.build(story)
buff.close()
buff = open(RECURSOS_DIR + '/pdf/vencimientos_tnr_mensual.pdf', 'rb')
response.write(buff.read())