Python: Catch multiple exceptions in one line (except block)

Enclose in parentheses:

except (IDontLIkeYouException, YouAreBeingMeanException) as e:
pass

Separating the exception from the variable with a comma will still work in Python 2.6 and 2.7, but is now deprecated; now you should be using as.

上一篇:【模拟】XMU 1599 斐波那契汤


下一篇:如何用Jquery实现 ,比如点击图片之后 ,该图片变成向下的箭头,再点击向下箭头的图片 又变成原始图片呢