Re: How to fix this error in the example in 6.1.4 Files and Directories

2005-04-15 Thread fuzzylollipop
can't see the forest for the trees, that seems to be the problem, thanks for pointing out the obvious ( that I couldn't see ) :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: How to fix this error in the example in 6.1.4 Files and Directories

2005-04-15 Thread fuzzylollipop
I am running 2.3.5 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to fix this error in the example in 6.1.4 Files and Directories

2005-04-15 Thread Peter Otten
fuzzylollipop wrote: > print sum([getsize(join(root, name)) for name in files]), > print sum([getsize(join(root,name)) from name in files]), Do you see the difference? ... for ... is the correct syntax, ... from ... is what Python seems to complain about. Peter -- http://mail.python.org/mail

Re: How to fix this error in the example in 6.1.4 Files and Directories

2005-04-15 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > the following code is from the Python 2.3.5 docs ( > http://www.python.org/doc/2.3.5/lib/os-file-dir.html ) > > import os > from os.path import join, getsize > for root, dirs, files in os.walk('python/Lib/email'): >print root, "consumes", >print sum([getsize(jo