如下所示,在不知道异常名的情况下可以捕获所有异常 try: a=b b=c except Exception,ex: print Exception,":",ex 转载于:https://www.cnblogs.com/dplearning/p/5708625.html