TypeError: 'module' object is not callable (newby question)
Charles Russell
SPAMworFREEwor at bellsouth.net
Mon Aug 14 16:59:03 EDT 2006
Marc 'BlackJack' Rintsch wrote:
>
> Don't call your file `glob.py` because then you import this module and not
> the `glob` module from the standard library.
>
> Ciao,
> Marc 'BlackJack' Rintsch
Yes, thanks. Renaming to myglob.py solved the problem. But why does the
conflict not occur when the code is run interactively from the python
prompt? Somewhat related - I haven't found the magic word to invoke a
.py script from the python prompt (like the command "source" in csh,
bash, tcl?) "import" runs the script, but then complains that it is not
a module.
More information about the Python-list
mailing list