print(module_name)
for name in dir(module):
    if type(getattr(module, name)) == types.ModuleType:
        list_modules('.'.join([module_name, name]))
Trying to print every submodule inside a module in python