How do I get a list of all python modules available?
I don't want modules of modules. Just a basic list of all modules available in sys.path
.
help('modules')
is not the solution, because I want it available as a variable and it imports those modules, which has side effects.
Edit: With side effects I mean libraries like kivy of http://kivy.org/, which make use of the fact, that code is executed once you import it.
pkgutil - Utilities to support packages
this will yield a tuple for all submodules on sys.path:
pkgutil.iter_modules()
to see what's loaded, look at:
sys.modules
"This is a dictionary that maps module names to modules which have already been loaded"
a list of loaded modules:
sys.modules.keys()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With