Don't understand error message

Lars Lundstedt lars.lundstedt at telia.com
Tue Apr 25 13:21:21 EDT 2000


I'm halfway through "Learning Python" and I'm stuck on the example on page
255.

It goes like this:

import sys, glob, operator
print sys.argv[1:]
sys.argv = reduce(operator.add, map(glob.glob, sys.argv))
print sys.argv[1:]

When called with "python glob.py *.py" on Win98 I'm supposed to get a list
of all .py files in the current directory but instead I get:

Traceback (innermost last):
  File "glob.py", line 1, in ?
    import sys, glob, operator
  File "glob.py", line 3, in ?
    list = reduce(operator.add, map(glob.glob, '*.py'))
TypeError: call of non-function (type module)

Anyone know why?

/LasseLu






More information about the Python-list mailing list