Module Is Not Callable

Gerrit Holl gerrit at
Sat Jan 11 16:33:41 CET 2003

beno schreef op zaterdag 11 januari om 16:06:35 +0000:
> Subject: Module Is Not Callable
> Hi;
> I have tested the following script and it works as long as I input it into 
> the command prompt. But when I try and write it to a script, then call the 
> script, I get the following error:
> >>> import test
> >>> import string
> >>> test()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: 'module' object is not callable
> Why?
> TIA,

A module is not supposed to be callable. A module is executed when it is
imported. Use execfile to execute a file without importing the module.

More information on modules: (read this first)


Asperger Syndroom - een persoonlijke benadering:
Het zijn tijden om je zelf met politiek te bemoeien:

More information about the Python-list mailing list