[Tutor] Python debugger

Kent Johnson kent37 at tds.net
Fri Jan 9 12:38:08 CET 2009


On Fri, Jan 9, 2009 at 3:27 AM, Michael Bernhard Arp Sørensen
<michael at arpsorensen.dk> wrote:
> Hi there.
>
> I've just started using the python debugger and I wonder how I could have
> lived without it earlier.
>
> I just wonder if there is a smarter way to show what all the variables
> contain in any given point in the debugger. I'm using this approach:
>
> import sys
> f = sys._getframe()
> p f.f_locals.items()
>
> It's not exacly pretty in its output, but it's better than nothing. Can this
> be done in a smarter way?

'a' will show the arguments to the current function; not the same but shorter.
p locals().items() is probably the same as what you are doing.

You might want to look at a graphical debugger such as winpdb.

Kent


More information about the Tutor mailing list