title: play a sound when the exception error occurs in python
body: <p>I want to get some data from another website using python <code>requests</code>. But sometimes the server does not reply correctly.</p>
  
  <p>I used <code>try</code> and <code>except</code> in my code and want to play a sound in the except block.</p>
  
  <p>I have already tried the following:</p>
  
  <pre class="lang-py prettyprint-override"><code>import winsound
  
  try:
      #do something
  except:
      winsound.Beep(400,400)
  </code></pre>
  
  <p>This code does not work when I executed it. It just raises the exception.</p>