This commit is contained in:
2023-04-19 20:24:03 -04:00
parent 451ee7a557
commit 9933b0b880
4 changed files with 41 additions and 8 deletions
+14
View File
@@ -0,0 +1,14 @@
import sys
# Iterate through the modules in sys.modules
for module_name, module in sys.modules.items():
# Check if the module has a loader attribute
if hasattr(module, '__loader__'):
loader = module.__loader__
# Determine the type of loader
if type(loader).__name__ == 'SourceFileLoader':
print(f"Module '{module_name}' has a source loader.")
elif type(loader).__name__ == 'BuiltinImporter':
print(f"Module '{module_name}' has a built-in loader.")
elif type(loader).__name__ == 'ExtensionFileLoader':
print(f"Module '{module_name}' has an extension loader.")