chila
chila

Reputation: 2442

How to know what modules where loaded by a module in python

I have a loaded module:

module = importlib.import_module('foo.bar.module')

How do I get a list of the modules loaded by 'foo.bar.module'?

Upvotes: 0

Views: 83

Answers (1)

idjaw
idjaw

Reputation: 26560

I think what you might be looking to do is a dir on the module.

Something like this:

module = importlib.import_module('foo.bar.module')
print(dir(module))

This will give you everything that is inside foo.bar.module

Upvotes: 1

Related Questions