Closed alexamici closed 8 years ago
pkgutil.iter_modules()
discovers most standard library modules (sys
is missing, why?).
Update: All clear now.
pkgutil.walk_packages
is the right tool for the job. See: http://stackoverflow.com/a/1708706/2948099
--wish-from-*
at the moment finds and imports only the top level modules.Only sub-modules explicitly imported from top level modules are imported, as a side effect. For example
import scipy
doesn't trigger the import of all SciPy sub-modules.The search for available code could be made more thorough, by using the module lookup strategies employed e.g. by IPython or using
pkgutil
directly.