7

I'd like to have the interactivity of pdb, but also need to use python's help function to introspect objects/methods that I am not familiar with using.

How can I use python's help() from pdb?

everything I try gives me:

(Pdb) help(help)
*** No help on (help)
(Pdb) help(list())
*** No help on (list())
2
  • I don't think you can unfortunately (it drives me crazy too). I usually have another tab with the interpreter running so that I can call help(). I really hope I'm wrong and there's a way to do this. Commented Apr 8, 2015 at 19:30
  • Related: python “help” function: printing docstrings Commented Apr 8, 2015 at 19:36

2 Answers 2

12

If you want to evaluate an expression using PDB, you use p.

(Pdb) p help(list)

The debugger command docs are here: PDB Debugger Commands

Sign up to request clarification or add additional context in comments.

Comments

4

I had problems to get help from pdb too but apparently, inserting ! before the command does the job like:

(Pdb++) !help(help)

1 Comment

Worked for me - Can you reference and authority that indicates this should be the cannonical answer?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.