[Python] Is there a way to access parent modules of an imported module object?

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    I need to know if there is a way to access parent modules from submodules. If I import submodule:

    from subprocess import types


    I have types - is there some Python magic to get access to subprocess module from types? Something similar to this for classes ().__class__.__bases__[0].__subclasses__().

    Continue reading...

Compartilhe esta Página