[Tutor] TimeOut in
alan.gauld at btinternet.com
Sun Nov 8 18:17:41 CET 2009
"somnath chakrabarti" <chakrabarti.somnath at gmail.com> wrote
> Below is the code that I have written to do the timeout implementation.
> I am getting error as follows. Can anybody please help me where I am
I have no idea how this framework is upposed to work but my
guess is that the problem lies here:
> def getSolution(self,solver):
> self.p = threading.Timer(100, self.onTimeout())
Thios looks like you should be providing a callback
function self.onTimeout but you are calling the function
instead of referencing it. This calls the method before
self.p has been defined.
You need to remove the parentheses after Timeout.
Author of the Learn to Program web site
More information about the Tutor