Module Browsing?

nomad nomad*** at ***freemail.absa.co.za
Wed May 9 04:53:47 EDT 2001


On Tue, 08 May 2001 22:30:16 GMT, "Nick Perkins" <nperkins7 at home.com>
wrote:

>I often find myself doing the following:
>
>1) hear about a cool module
>2) install it, or (more often),
>   find that i already have it (but didn't know about it)
>3) >>>import cool
>4) >>>dir(cool)
>5) >>>cool.something(
>(..see if IDLE shows an informative tool tip)
>5) if it does, it's a function, i try it out
>6) if not, it's a value, i see what it is
>7) if the value is an object, i dir() it....
>
>What I want to know is:
>
>Is there an easier way to 'browse' a module from the command line?
>I would like to able to (quickly) see module values and their type,
>module functions and their parameters and doc strings, etc.
>
>Is there a way to get a list of modules that i have installed?
>If i wrote a script to do this, how would it work?
>e.g.( walk sys.path, list all .py files, etc..)
>
>( but i'm sure it has been done, i just don't understand
>  how modules work well enough )
>
>...here's another thing:
>can i import a module that is not on the sys.path
>by giving it's full path?
>
I don't know about browing from the command line, but the 'path
browser' option in IDLE, or the 'browser' option in Pythonwin both
work nicely for me, although the Pythonwin browser will probably give
you more satisfaction.  (I'm guessing by your usinging outlook express
that you use Python on a Win32 platform?)

Both of the above options will also show you which modules are
installed on you file system.

HTH



More information about the Python-list mailing list