another problem with modules
Robert Kern
robert.kern at gmail.com
Thu Feb 17 12:26:22 EST 2011
On 2/17/11 11:11 AM, Tim Hanson wrote:
> import pypath
> import intersect #the name of a file that contains the above short function.
> intersect('spam','spmmer')
>
> Traceback (most recent call last):
> File "<pyshell#2>", line 1, in<module>
> intersect('spam','spmmer')
> TypeError: 'module' object is not callable
>>>>
>
> Huh? Why doesn't this run when imported? More importantly, how do I
> interpret this error message so that I can find the problem myself next time?
Please read the first section of this page about modules in the tutorial:
http://docs.python.org/tutorial/modules.html#modules
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-list
mailing list