bruno at modulix wrote:
>> Otherwise, just to be informed, what advantage does rstrip() have over >> [:-1] (if the two cases are considered uneventfully the same)? > > 1/ if your line doesn't end with a newline, line[:-1] will still remove > the last caracter. > In particular, if the last line of the file doesn't end with a newline then the last line you read won't have a newline to be stripped. -- http://mail.python.org/mailman/listinfo/python-list