[Twisted-Python] Newbie question

Christopher Armstrong radix at twistedmatrix.com
Thu Jan 24 15:04:29 EST 2008


On Jan 24, 2008 2:33 PM, Simon Pickles <sipickles at hotmail.com> wrote:
> Hi,
>
> I thought I'd better try and understand twisted a bit more rather than
> just using it!
>
> Can anyone tell me why this code is erroneous?
>
> #####################
...
> reactor.callLater(4, d.callback)
...
> ###################################
> I get the error:
>
> TypeError: callback() takes exactly two arguments (1 given) in
> twisted/internet/base.py call.func(*call.args, **call.kw)

d.callback needs an argument. You're not passing one. Try:

reactor.callLater(4, d.callback, "whatever")



-- 
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/




More information about the Twisted-Python mailing list