title: Python try/except: Showing the cause of the error after displaying my variables
body: <p>I'm not even sure what the right words are to search for. I want to display parts of the error object in an except block (similar to the err object in VBScript, which has Err.Number and Err.Description).  For example, I want to show the values of my variables, then show the exact error.  Clearly, I am causing a divided-by-zero error below, but how can I print that fact? </p>
  
  <pre><code>try: 
      x = 0 
      y = 1 
      z = y / x 
      z = z + 1 
      print "z=%d" % (z) 
  except: 
      print "Values at Exception: x=%d y=%d " % (x,y) 
      print "The error was on line ..." 
      print "The reason for the error was ..." 
  </code></pre>