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 loadedsys.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.
Why not work out what’s part of the standard library yourself?
gives
Edit: You’ll probably want to add a check to avoid
site-packagesif you need to avoid non-standard library modules.