J
je.s.te.r
I've been using the HyperText module for a while now
(http://dustman.net/andy/python/HyperText/), and I really like it.
I've run into a situation where I have code to construct a table
and while it is normally perfect, there are times where the table
can get quite huge (e.g. 1000 columns, 100000 rows .... yes, the
question of "how on earth would someone render this table?" comes
up, but that's not the point here
), and the code I have generating
this starts choking and dying from excessive RAM usage.
I'm curious if people see a better way of going about this task and/or
believe that an alternative method of HTML generation here would be
better.
A (possibly somewhat pseudocode, as I'm doing this by hand) small example
of what I'm doing ...
inputs = [A, List, Of, Values, To, Go, Into, A, Table]
numcolumns = howManyColumnsIWant
out = ht.TABLE()
column = 0
for input in inputs:
if (column == 0):
tr = ht.TR()
tr.append(ht.TD(input))
column += 1
if (column == numcolumns):
out.append(tr)
column = 0
As I said, this works fine for normal cases, but I've run into some situations
where I need this to scale not just into the hundreds of thousands but also
well into the millions - and that's just not happening. Is there a better
way to do this (which involves direct HTML generation in Python), or am
I SOL here?
(http://dustman.net/andy/python/HyperText/), and I really like it.
I've run into a situation where I have code to construct a table
and while it is normally perfect, there are times where the table
can get quite huge (e.g. 1000 columns, 100000 rows .... yes, the
question of "how on earth would someone render this table?" comes
up, but that's not the point here
this starts choking and dying from excessive RAM usage.
I'm curious if people see a better way of going about this task and/or
believe that an alternative method of HTML generation here would be
better.
A (possibly somewhat pseudocode, as I'm doing this by hand) small example
of what I'm doing ...
inputs = [A, List, Of, Values, To, Go, Into, A, Table]
numcolumns = howManyColumnsIWant
out = ht.TABLE()
column = 0
for input in inputs:
if (column == 0):
tr = ht.TR()
tr.append(ht.TD(input))
column += 1
if (column == numcolumns):
out.append(tr)
column = 0
As I said, this works fine for normal cases, but I've run into some situations
where I need this to scale not just into the hundreds of thousands but also
well into the millions - and that's just not happening. Is there a better
way to do this (which involves direct HTML generation in Python), or am
I SOL here?