Jörg Haubrichs
Jörg Haubrichs

Reputation: 2243

Python object inspector?

besides from using a completely integrated IDE with debugger for python (like with Eclipse), is there any little tool for achieving this:

It doesnt need to be polished, not even absolutely stable, it could be introspection example code for some widget library like wx. Platform independent would be nice though (not a PyObjC program, or something like that on Windows).

Any Ideas ?

Edit: Yes, i know about pdb, but I'm looking for a graphical tree of all the current objects.

Nevertheless, here is a nice introduction on how to use pdb (in this case in Django): pdb + Django

Upvotes: 2

Views: 2794

Answers (5)

nosklo
nosklo

Reputation: 222862

Winpdb is a platform independent graphical GPL Python debugger with an object inspector.

It supports remote debugging over a network, multiple threads, namespace modification, embedded debugging, encrypted communication and is up to 20 times faster than pdb.

Some other features:

  • GPL license. Winpdb is Free Software.
  • Compatible with CPython 2.3 through 2.6 and Python 3000
  • Compatible with wxPython 2.6 through 2.8
  • Platform independent, and tested on Ubuntu Jaunty and Windows XP.
  • User Interfaces: rpdb2 is console based, while winpdb requires wxPython 2.6 or later.

Here's a screenshot that shows the local object tree at the top-left.

Screenshot
(source: winpdb.org)

Upvotes: 5

sunqiang
sunqiang

Reputation: 6492

Python Debugging Techniques is worth reading. and it's Reddit's comment is worth reading too. I have really find some nice debug tricks from Brian's comment. such as this comment and this comment.
Of course, WingIDE is cool (for general Python coding and Python code debugging) and I use it everyday. unlucky for WingIDE still can't embedded a IPython at now.

Upvotes: 1

Alex Martelli
Alex Martelli

Reputation: 881715

If a commercial solution is acceptable, Wingware may be the answer to the OP's desires (Wingware does have free versions, but I don't think they have the full debugging power he requires, which the for-pay versions do provide).

Upvotes: 1

Ned Batchelder
Ned Batchelder

Reputation: 375594

pdb isn't windowed, it runs in a console, but it's the standard way to debug in Python programs.

Insert this where you want to stop:

import pdb;pdb.set_trace() 

you'll get a prompt on stdout.

Upvotes: 2

Peter
Peter

Reputation: 132247

You can use ipython, with the %debug statement. Once your code crashes, you can add breakpoints, see objects etc. A very crude way to kickoff the debugger is to raise Exception at some line of your code, run it in ipython, the type %debug when it crashes.

Upvotes: -1

Related Questions