traceback tool to increase efficiency.

Richie Hindle richie at
Tue Aug 13 13:25:53 CEST 2002


> I want this because I have a 5000 line program that I need to get 
> familiar with, and its pretty much sphagetti code. Doing a normal run of 
> the program, and then being able to look at the methods that have been 
> called would be a great help.

You'd be better off using a debugger to step through the program.  A
debugger will show you the functions *as they run*, and let you look
at the program data as well, and even change the data as the program
runs to see what effect different data will have.  At any moment you
can see the call stack, to see how you arrived in the function you're
in.  A debugger is a great tool for learning about existing code.

Python debuggers include (off the top of my head) -

 o pdb, the default command-line debugger shipped with Python
 o Idle, the default Python IDE, also shipped with Python
 o PythonWin (open source for Windows only, shipped with ActivePython)
 o MacPython (open source, only for Mac)
 o BoaConstructor (open source, also a GUI builder for wxPython)
 o Data display debugger (aka DDD) (open source)
 o HAP Debugger (open source, Windows only at the moment I think)
 o PythonWorks Pro (commercial)
 o WingIDE (commercial)
 o Komodo (commercial)
 o BlackAdder (commercial, still in beta)
 o VisualPython (commercial, a plug-in for MS Visual Studio.NET)

If you're on Windows I'd recommend PythonWin as a starting point, or
MacPython if you're on a Mac, or Idle otherwise.

Richie Hindle
richie at

More information about the Python-list mailing list