[Twisted-Python] Re: Re: rewrite of flow.py completed
Philippe Lafoucrière
lafou at wanadoo.fr
Tue Apr 15 04:05:41 EDT 2003
Sorry to bother you again but I don't understand how to link a QueryIterator
with "standart" consumer... :(
even with a simple exemple, I can't have QueryIterator to work :
dbpool = adbapi.ConnectionPool("MySQLdb",
host=host,
db='MYDB',
user='USER',
passwd='PASS')
sql = """SELECT nom FROM dbo_questionnaire limit 0,50"""
queryIt = QueryIterator(dbpool, sql)
def res(x): print "Results : ", x
from twisted.internet import reactor
f = flow.DeferredFlow(queryIt)
f.addCallback(res)
reactor.callLater(2,reactor.stop)
reactor.run()
Just give me this ouput :
Results : []
Thank you !
More information about the Twisted-Python
mailing list