johnny wrote: > In my code, I have the following: > > p = posixpath.basename(e).strip > filename = download_dir+p > > I am getting the following error: > > filename = download_dir+p > TypeError: cannot concatenate 'str' and 'builtin_function_or_method' > objects > >
You need to *call* the strip method. To see what you've actually done, do this: p = posixpath.basename(e).strip print repr(p) filename = download_dir+p To see what happens when you've fixed the problem, do this: p = posixpath.basename(e).strip() print repr(p) filename = download_dir+p *and* for portability, *don't* use "posixpath", just use "path" HTH, John -- http://mail.python.org/mailman/listinfo/python-list