[EMAIL PROTECTED] wrote:
> Thanks! I was trying len(cpn_version) and that didn't work.
What's your problem? You get a value that's one more than
you expected? You should use splitlines() instead of split('\n'),
or easier, use readlines() instead of read(). Of course, with
a modern python you can
Elliot Temple wrote:
>
> 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
Thanks! I was trying len(cpn_version) and that didn't work.
--
http://mail.python.org/mailman/listinfo/python-list
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:
co
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.
--
http://mail.python.org/mailman/listinfo/python-list