Creatively... Do!
  • Home
  • Blog
  • Contact
  • Programming
    • Solitaire
    • Minesweeper
    • Sudoku
    • Pong
    • Mandelbrot
  • Music
    • The Snowman

Blog

  • Home
  • Blog
  • October, 2013

Viewing posts from October, 2013

How to globally customize exception stack traces in Python

Posted by: christian_abbott in python 7 years, 3 months ago

The Python programming language has some useful flexibility which it can take a while to discover. One such example is exceptions. As programmers, we want as much relevant information as we can get when something goes unexpectedly wrong in our programs. When an unhandled exception bubbles up, Python's default behavior is to print a stack trace, the type of error, and an error description. This is printed to sys.stderr (i.e., the console window, typically), like this:

read more / 1 comment

Recent Posts

  • Using SVG and CSS to create Pacman (out of pie charts)
  • How to solve the Impossible Escape puzzle with almost no math
  • How to make iterators out of Python functions without using yield
  • How to globally customize exception stack traces in Python
  • Is your tango embrace really too firm or too relaxed?

Archive

2017
  • May (1)
2015
  • February (1)
2013
  • November (1)
  • October (1)
  • March (1)
  • February (3)
  • January (4)
2012
  • December (1)

Categories

  • django (2)
  • environment (1)
  • math (2)
  • python (2)
  • tango (5)
  • web development (1)

Authors

  • christian_abbott (13)

Feeds

RSS / Atom
  • Blog
  • Contact
  • Programming
  • Music
©2012-2020 Christian Abbott