Arash Arfaee wrote:
> is there any way to check if "IndexError: list index out of
> range" happened or going to happen and stop program from terminating?

Use a try/except block to catch the IndexError
http://docs.python.org/tut/node10.html#SECTION0010300000000000000000

try:
    do_something_0(M_list[line][row][d])
except IndexError:
    do_something_1()

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

Reply via email to