I'm not exactly new to Python, but I do still have trouble understanding what makes something "Pythonic" (and the converse).
So forgive me if this is a stupid question, but why can't I get the size of a file by doing a len(file)?
file is an iterator. To find the number of lines you need to read the entire file
sum(1 for line in file)
if you want the number of bytes in a file, use
import os os.stat(filename).st_size