views:

98

answers:

3

I wanted a list of my modules and was told:

>>> help('modules')

Would do the trick. But I just get

Please wait a moment while I gather a list of all available modules...

For over 10 minutes before I killed it.

Anyone know what could be causing this? Or how I could otherwise see my modules? (System Ubuntu 9.10/Python 2.6.4)

Thanks,

Dan

+1  A: 

If you want to see the modules you have *import*ed (directly or indirectly),

>>> import sys
>>> print sys.modules

help('modules') is about all modules that are available -- i.e. ones you *could import if you wished. It doesn't take anywhere as long for me as it does for you, but if you have installed enough extensions it could have thousands, or tens of thousands, "potential" modules to show, so it's not surprising that it might take a bit of time gathering that info.

Alex Martelli
I'm mainly trying to find a list so that I can see the name of my recently installed graphviz module which doesn't see to be found by any of the names I've tried.
Dan
A: 

Make sure that you can import the module.

import modules

For which module do you want help? Is it your own module or third-party?

luc
I want to see a list of all my available modules.
Dan
So you should follow Alex Martelli recommendation
luc
+1  A: 

Install ipython

$ sudo apt-get install ipython

Then run ipython and type import <tab> where <tab> is the tab key

If you've installed the python-pygraphviz package, you can use

import pygraphviz
gnibbler
Awesome! You can also see all the items within the class using this. Thanks!
Dan