TypeError: 'module' object is not callable

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Mar 17 10:53:22 CET 2007


En Fri, 16 Mar 2007 14:42:49 -0300, <randomtalk at gmail.com> escribió:

> 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

It's always better to post the *whole* code.
I assume you wrote:
import profile
profile('...')
But profile is the module name; you want to call the `run` function inside  
the profile module instead:

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

Look at the docs for the profile module at  
http://docs.python.org/lib/lib.html or typing help(profile) at the  
interpreter prompt.

-- 
Gabriel Genellina




More information about the Python-list mailing list