擅长:python、mysql、java
<p>您可以使用<a href="https://docs.python.org/2/reference/compound_stmts.html#the-try-statement" rel="nofollow">^{<cd1>}</a>:</p>
<pre><code>try:
assert False
print "Hello"
except AssertionError:
pass
finally:
print "This prints no matter what"
This prints no matter what
</code></pre>
<p>如果要在没有发生错误的情况下执行代码块,可以使用<code>try except else</code>构造。在</p>