List of modules available for import inside Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fredrik Lundh

    #16
    Re: List of modules available for import inside Python?

    Michele Simionato wrote:
    I have just tried the following on my Ubuntu box with the system
    Python:
    >
    ~$ python /usr/lib/python2.5/doc/tools/listmodules.py
    /usr/lib/python2.5/doc/tools/listmodules.py: 99: DeprecationWarn ing:
    the rgbimg module is deprecated
    __import__(m)
    >
    ** (process:24863) : WARNING **: AT_SPI_REGISTRY was not started at
    session startup.
    >
    ** (process:24863) : WARNING **: Could not locate registry
    location: /usr/lib/xulrunner-1.9.0.1/libxpcom.so
    before 3
    /usr/lib/python2.5/doc/tools/listmodules.py: 99: Warning: cannot
    register existing type `GtkSourceStyle Scheme'
    __import__(m)
    /usr/lib/python2.5/doc/tools/listmodules.py: 99: Warning:
    g_type_set_qdat a: assertion `node != NULL' failed
    __import__(m)
    /usr/lib/python2.5/doc/tools/listmodules.py: 99: Warning: cannot
    register existing type `GtkSourceBuffe r'
    __import__(m)
    /usr/lib/python2.5/doc/tools/listmodules.py: 99: Warning:
    g_type_get_qdat a: assertion `node != NULL' failed
    __import__(m)
    Segmentation fault
    >
    Interesting, isn't it?
    it does indeed import modules found in the path if they appear to be
    Python C extensions. why Ubuntu puts badly written C modules in their
    default Python path is more than I can tell...

    </F>

    Comment

    • Anita Kean

      #17
      Re: List of modules available for import inside Python?

      On 2008-09-10, denisbz@t-online.de <denisbz@t-online.dewrote:
      (snip) ...
      >
      So to refine the question:
      how can I list all modules that might be importable on my system,
      without actually importing them all ?
      >
      (How about a "pydoc2" that's well thought out, doesn't crash ...
      let me ask more knowledgable people, what's a good small help system
      as model ?
      )


      I'm constantly finding myself wishing for this feature -
      something of the "apropos"/"whatis" of the linux shell (and debian's
      "apt-cache search" and "apt-cache show" which allow you to search
      and query before you install).
      (Matlab's "help" and "lookfor" commands cover this too.)

      Is there a reason this type of information hasn't been made available
      by default in the help system?
      I'm constantly using find, grep and Usenet to find out what python tools
      I can use.

      Anita



      Comment

      Working...