[Tutor] Python debugger

Michael Bernhard Arp Sørensen michael at arpsorensen.dk
Fri Jan 9 13:36:25 CET 2009


Hi.

Thanks for the input. Your way of doing it is simpler and possible to use as
an alias in pdb.

I can't use a graphical debugger because i mostly code python over ssh on
remote servers in my company.

Thanks anyway. It was actually helpfull. :-)

/Michael

On Fri, Jan 9, 2009 at 12:38 PM, Kent Johnson <kent37 at tds.net> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090109/8c6dfd80/attachment.htm>


More information about the Tutor mailing list