6

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())
ThorSummoner
  • 16,657
  • 15
  • 135
  • 147
  • 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. – notorious.no Apr 08 '15 at 19:30
  • Related: [python “help” function: printing docstrings](http://stackoverflow.com/questions/7123660/python-help-function-printing-docstrings) – kojiro Apr 08 '15 at 19:36

2 Answers2

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

valdarin
  • 921
  • 10
  • 20
2

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

(Pdb++) !help(help)
MarcoMag
  • 556
  • 7
  • 18