title: On Error Resume Next in Python
body: <h3>Snippet 1</h3>
  
  <pre><code>do_magic() # Throws exception, doesn't execute do_foo and do_bar
  do_foo()
  do_bar()
  </code></pre>
  
  <h3>Snippet 2</h3>
  
  <pre><code>try:
      do_magic() # Doesn't throw exception, doesn't execute do_foo and do_bar
      do_foo() 
      do_bar()
  except:
      pass
  </code></pre>
  
  <h3>Snippet 3</h3>
  
  <pre><code>try: do_magic(); except: pass
  try: do_foo()  ; except: pass
  try: do_bar()  ; except: pass
  </code></pre>
  
  <p>Is there a way to write code snippet 3 elegantly?</p>
  
  <ul>
  <li>if <code>do_magic()</code> fails or not, <code>do_foo()</code> and <code>do_bar()</code> should be executed.</li>
  <li>if <code>do_foo()</code> fails or not, <code>do_bar()</code> should be executed.</li>
  </ul>
  
  <p>In Basic/Visual Basic/VBS, there's a statement called <code>On Error Resume Next</code> which does this.</p>