Whenever writing anything, pay attention to those tracebacks. Having only had the benefit of three-word PHP errors and next to useless JavaScript errors, I haven’t been used to checking out error messages. I’ve been getting better, especially with the WebKit developer tools in Safari and Chrome, but tracebacks in Python carry a lot if information.
You can view the outcome of a fatal error by running your application from IDLE, Python’s native editor. Once you’ve opened your app in IDLE, focus on to the shell window and execute the script (F5 on Windows). If you’re getting a fatal error but want to carry on executing after the bug is raised, use an exception to carry on past the error.
import traceback
try:
# bad code here
except:
traceback.print_exc()
Remember, tracebacks carry all that sexy information in a long list of jargon. But make sure you read the shell window, and never hide anything behind a try: in the hope that it’ll go away some day. I naively tried that a couple of times, but it just kept coming back to haunt me.