number of lines in a file

Emile van Sebille emile at fenx.com
Fri Mar 29 09:36:14 EST 2002


Joseph Youssef
> hello, I am nwe to Python and I'm trying to write this 
> script but I need it to check how many lines is in 
> the file and I don't know how so I'm hoping someone 
> could tell me.


len(open('/path/and/filename').readlines())

-- 

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list