2011-11-22 50 views

回答

0

您可以使用Python的异常处理:

try: 
    do_something() 
except Exception, ex: 
    print "The process failed because", ex 
    do_something_else() 

更换do_something()的代码,你首先要尝试。与你的愿望更换do_somthing_else()代码do_something时尝试()部分失败

Reference for Exception Handling