python exception handling exception

                      

Use try statement detects abnormal

 

 as reason can be saved, what input the wrong time wrong reason should be converted into a string, or else also will complain oh

 

 If you want to capture multiple setting error, write more except, or writing a single line

 

 

Of course, only output one exception occurs because the first statement that try to jump except go, and C # try catch as

But the try except we only catch exceptions set, except no exception is not caught, will still error!

 

 If you want no matter what wrong have come except to go, it does not follow directly after except something like

But you can not know the error message , and therefore do not recommend this practice

 

 

 

 

 raise himself an exception is thrown

 

 

Guess you like

Origin www.cnblogs.com/ningxinjie/p/10949104.html