TypeError: 'module' object is not callable (newby question)

faulkner faulkner612 at comcast.net
Mon Aug 14 14:23:30 EDT 2006


works for me. do you do anything in your script besides that?


Charles Russell wrote:
> Why does this work from the python prompt, but fail from a script?
> How does one make it work from a script?
>
> #! /usr/bin/python
> import glob
> # following line works from python prompt; why not in script?
> files=glob.glob('*.py')
> print files
>
> Traceback (most recent call last):
>    File "./glob.py", line 2, in ?
>      import glob
>    File "/home/cdr/python/glob.py", line 5, in ?
>      files=glob.glob('*.py')
> TypeError: 'module' object is not callable




More information about the Python-list mailing list