[Tutor] way to see code execution in real-time?

Kent Johnson kent37 at tds.net
Fri Oct 16 20:24:56 CEST 2009


On Fri, Oct 16, 2009 at 1:43 PM, Serdar Tumgoren <zstumgoren at gmail.com> wrote:
> Hey everybody,
>
> Thanks for the recommendations -- I usually do use pdb to step through
> chunks of code, but always by setting a breakpoint. And then I have to
> "manually" print out the variables to see what's going on in the code.

WinPdb (sorry, not WinDbg) or other graphical debuggers will show you
the variables.
http://winpdb.org/docs/

>
> Is there a way to wrestle pdb into spitting out the code being
> executed, as it executes (without having to manually do so myself)?

You can do this with the settrace() function. Here is an example:
http://www.dalkescientific.com/writings/diary/archive/2005/04/20/tracing_python_code.html

Kent


More information about the Tutor mailing list