On May 27, 2005, at 12:17 PM, [EMAIL PROTECTED] wrote:

> I have read in a file and need to get the number of lines.
>
>     cpn_file = open('Central Part number list.txt')
>     cpn_version = cpn_file.read().split('\n')
>
> I want to know the number of elements in cpn_version.

Could you use:

count_lines = len(cpn_file.readlines())

-- Elliot Temple
http://www.curi.us/


---
[This E-mail scanned for viruses by Declude Virus]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to