Extending the interactive mode [not really an ANN :) ]

Sean 'Shaleh' Perry shalehperry at attbi.com
Sat Mar 23 15:09:07 EST 2002


On 23-Mar-2002 Tjabo Kloppenburg wrote:
> hi,
> 
> I use python22 and dreamt about a comfortable way of using the interactive 
> mode to find information about what methods/functions a class/module provides
> and what the helpful __doc__ string says (keeping ri [ruby] in my mind).
> 
> The annoying way to do this in python interactive mode -- with lots of key 
> strokes and many risks of mistypnig -- is to type:
>   print mod.__doc__     +Enter
>   print dir(mod)    +Enter
> 
> So I finally wrote a very small function to be loaded from PYTHONSTARTUP when
> using interactive mode. It is self explanatory and gives you information 
> about a module by typing "info(mod)". Fairly easy...
> 

from pydoc import help
help()

give that a shot.




More information about the Python-list mailing list