[Twisted-Python] Writing a plug-in for an online game that uses UDP

Sam Couter sam at couter.dropbear.id.au
Mon Jul 26 20:41:22 EDT 2004


Ibrahim Mubarak <ibmub80 at yahoo.com> wrote:
> ////////CODE START\\\\\\\\
> from twisted.enterprise import adbapi
> dbpool = adbapi.ConnectionPool("MySQLdb", 'iiwu_database', 'login', 'password')

[ ... ]

> getUserData("ib").addCallback(printResult).addErrback(printError)
> print "\nEND OF FILE\n"
> \\\\\\\\CODE END////////
> I do see the "END OF FILE" printed, but that's it. Do you have any idea what is going on?

The dbpool isn't started unless you start the dbpool directly with
dbpool.start() or start the reactor with reactor.run(). Either way, if
you want your script to terminate after you get your results, you should
add another callback that calls dbpool.stop() or reactor.stop().
-- 
Sam "Eddie" Couter  |  mailto:sam at couter.dropbear.id.au
Debian Developer    |  mailto:eddie at debian.org
                    |  jabber:sam at teknohaus.dyndns.org
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040727/e2047004/attachment.pgp 


More information about the Twisted-Python mailing list