IndexError: string index out of range

Jose' Sebrosa sebrosa at artenumerica.com
Wed Apr 11 23:00:17 EDT 2001


f.readline() in your function function get_line() eventually returns '', and
then you are trying to extract the first element of an empty string:

''[0]

This produces an IndexError.

Sebrosa



More information about the Python-list mailing list