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

Peter Otten __peter__ at web.de
Fri Apr 15 13:20:17 EDT 2005


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






More information about the Python-list mailing list