Python3 异常处理 捕获全部异常 12345 try: a=b b=c except Exception,e: print Exception,":",e 各种异常清单 抛出异常 1 raise NameError('HiThere') 若想知道是否抛出了异常 12345678910 >>> try: raise NameError('HiThere') except NameError: print('An exception flew by!') raise An exception flew by!Traceback (most recent call last): File "<stdin>", line 2, in ?NameError: HiThere 赞微海报分享
近期评论