List of all imports in python 3
Question: How to find out list of all available imports in python 3 via program? I tried
this at first, but couldn't understand what it returned

    
    
    import sys
        sys.modules
    

I think this isn't the way, although this struck my mind first. I searched the
web and found this <http://effbot.org/librarybook/core-modules-index.htm>

Can someone tell me whether this is correct or not?


Answer: From <http://docs.python.org/library/sys.html> (a good place to look for
documentation on python stdlib)

> **sys.builtin_module_names**
>
> is a tuple (a bit like a immutable anonymous structs) of strings giving the
> names of all modules that are compiled into this Python interpreter.
>
> **sys.modules**
>
> This is a dictionary that maps module names to modules (module objects)
> which have already been loaded. This can be manipulated to force reloading
> of modules and other tricks. Note that removing a module from this
> dictionary is not the same as calling `reload()` on the corresponding module
> object.

So modules is a dictionary (a mapping of module names to the actual module
objects). To get just the names type `sys.modules.keys()` although it probably
isn't that usefull.

