+ 1

Error messages in python

When python is executing a chain of command if it get to an in correct command it stops there and even if the next command(s) is/are correct it wouldn't run them. Why?

19th Dec 2017, 7:41 AM
Peter Bemshima
Peter Bemshima - avatar
4 Respostas
+ 3
Because when one error has ocurred, future instructions aren't guaranteed to work properly, data may be corrupted or more and worse errors may occur. So when program integrity is compromised, execution stops. If you want to ignore some errors, you need to use try-catch blocks.
19th Dec 2017, 7:55 AM
spcan
spcan - avatar
+ 2
it's sort of like trying to follow someone's commands and suddenly they say, "do mummmblegrumblegrarg." I don't know about you, but I'd sit there and scratch my head trying to figure out what they mean and stop listening.
19th Dec 2017, 8:00 AM
Lysis
Lysis - avatar
+ 1
imagine building a house, you are all done and only thing left to build is the roof when suddenly one of your walls collapses. Would you still build the roof ignoring one wall is gone or would you stop?
19th Dec 2017, 7:58 AM
Jeremy
Jeremy - avatar
+ 1
Thank you very much. All of you
19th Dec 2017, 8:38 AM
Peter Bemshima
Peter Bemshima - avatar