TypeError: 'module' object is not callable

kyosohma at gmail.com kyosohma at gmail.com
Fri Mar 16 14:48:27 EDT 2007


On Mar 16, 12:42 pm, randomt... at gmail.com wrote:
> Hello everyone!
> i have the following test code:
> class temp:
>     def __init__(self):
>         self.hello = "hello world!"
>     def printworld(self):
>         print(self.hello)
> t = temp()
>
> and i tried to call profile('t.printworld()')
>
> but i received the following error:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: 'module' object is not callable
>
> I'm not sure what is wrong exactly, if anyone can point me to the
> right direction, it would be much appreciated!



If you're using the profile module, you need to do something like

profile.run('t.printworld()')

Good luck,

Mike




More information about the Python-list mailing list