加载中...

Python

  1. Home
  2. Computing & Technology
  3. Python

Part 4: Handling Errors the Way You Want

From Al Lukaszewski, for About.com

4 of 7

Reading Python's Error Message: Part 1

Now, let's consider the error message. Python conveniently gives us a traceback of the execution process with the most recent call listed last. Because each part of this program could be held in separate files, possibly being re-used from other applications, Python tells us in which file, on which line number, and in which function each error occurs. All line numbers are listed relative to the file in which they are found -- not relative to the cumulative number of program lines. As the most recent call is listed last, we know that the error messages are nested, each error after the first occuring within the execution of the previous error.

Click to the next page to look at this message line-by-line.

Explore Python

About.com Special Features

Build Your Own Website

Easy guides to creating your own blog, online photo album or wiki. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Python

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.