best solution to for loop
mauricio.tellez at gmail.com
Thu Sep 22 04:55:02 CEST 2005
Hi, I have several apps which connect to a database, fetch some data an put
this into a gtk.TreeStore, but if the result set is 1500 row long, the app
response slowly, how can optimize this? here is an example of what I do:
cur.execute("SELECT * FROM clients")
data = cur.fetchall()
for row in data:
treeStore.append(row, row, row, "Ohio", row)
I read Guido's An Optimization Anecdote
http://www.python.org/doc/essays/list2str.html) and perhaps filter() or
something like that could help. Any clue?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list