From within a script, I would like to get a list of all the modules in the project.
I can get all the imported modules using this:
import sys for name, module in sys.modules.items(): if 'project' in name: print name
but I would like to get a list of all modules (or filenames), even if they haven’t been imported yet.
As they haven’t been imported, I may need to query the underlying structure where the modules are stored, but I have no idea of how to do this?