[Python] How to get a list of all the Python standard library modules?

Discussão em 'Python' iniciado por Stack, Agosto 28, 2025.

  1. Stack

    Stack Membro Participativo

    I want something like sys.builtin_module_names except for the standard library. Other things that didn't work:

    • sys.modules - only shows modules that have already been loaded
    • sys.prefix - a path that would include non-standard library modules and doesn't seem to work inside a virtualenv.

    The reason I want this list is so that I can pass it to the --ignore-module or --ignore-dir command line options of trace.

    So ultimately, I want to know how to ignore all the standard library modules when using trace or sys.settrace.

    Continue reading...

Compartilhe esta Página