Module Is Not Callable

beno zope at thewebsons.com
Sat Jan 11 11:15:14 EST 2003


At 04:33 PM 1/11/2003 +0100, you wrote:
>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:
>http://www.python.org/dev/doc/devel/tut/node8.html (read this first)
>http://www.python.org/dev/doc/devel/ref/import.html#l2h-358

Thank you!
beno







More information about the Python-list mailing list