欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Twisted
来自开放百科 - 灰狐
(版本间的差异)
第9行: | 第9行: | ||
>>> def printContents(contents): | >>> def printContents(contents): | ||
print "The Deferred has called printContents with the following contents:" | print "The Deferred has called printContents with the following contents:" | ||
− | print contents | + | |
− | reactor.stop() | + | print contents |
+ | |||
+ | reactor.stop() | ||
>>> deferred = getPage('http://www.huihoo.com/') | >>> deferred = getPage('http://www.huihoo.com/') | ||
>>> deferred.addCallback(printContents) | >>> deferred.addCallback(printContents) |
2007年2月21日 (三) 13:41的版本
Twisted is an event-driven networking framework written in Python and licensed under the MIT license.
Guide
http://twistedmatrix.com/trac/wiki/Downloads >>> from twisted.web.client import getPage >>> from twisted.internet import reactor >>> def printContents(contents):
print "The Deferred has called printContents with the following contents:"
print contents
reactor.stop() >>> deferred = getPage('http://www.huihoo.com/') >>> deferred.addCallback(printContents) <Deferred at 0xb9afd0> >>> reactor.run()
分享您的观点