How to count lines in a text file ?

Erik Heneryd erik at heneryd.com
Mon Sep 20 10:12:09 EDT 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