user1953384
user1953384

Reputation: 1059

iPython - library function help in debug mode

I was wondering how to access the help page of library functions when I'm in the debug mode in iPython. For instance,

ipdb> help(numpy.random.randn)

does not work in debug mode, as it is not an ipdb command.

I can do something like this in Matlab, where

K>> help(randn)

returns the help page of randn even though I'm in debug mode.

Upvotes: 2

Views: 308

Answers (3)

Martijn Pieters
Martijn Pieters

Reputation: 1125028

Use !help(numpy.random.randn) instead in pdb.

The ! exclamation mark ensures that pdb does not try to execute the line as a pdb command, passing it to the Python interpreter instead.

Upvotes: 2

Tuxdude
Tuxdude

Reputation: 49593

It has been long since I used iPython, but I think you should be able to do this:

ipdb> import numpy
ipdb> import pydoc
ipdb> pydoc.help(numpy.random.randn)

Upvotes: 0

reader_1000
reader_1000

Reputation: 2501

I don't have ipython installed but most probably you can access the help with

print randn.__doc__

Upvotes: 0

Related Questions