> On Sep 28, 7:13 pm, alex23 <[EMAIL PROTECTED]> wrote:
>> The problem is with this:
>>
>> >         lines = lines.append(inLine)
>>
>> The append method of a list modifies the list in-place, it doesn't
>> return a copy of the list with the new element appended. In fact, it
>> returns None, which it then attaches the label 'lines' to, so the next
>> iteration through it tries to call None.append...
>>
>> Replace the line with:
>>
>>     lines.append(inLine)
> 
> Do you ever want to scream from the rooftops, "'append' operates by
> side-effect!"?

Ah! Thanks, especially for the quick response.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to