How to count lines in a text file ?

Erik Heneryd erik at heneryd.com
Mon Sep 20 16:12:09 CEST 2004


Phil Frost wrote:
> another alternative is to use the standard posix program "wc" with the
> -l option, but this isn't Python.
> 

Not the same thing.  wc -l counts newline bytes, not "real" lines.


Erik



More information about the Python-list mailing list