LINUX.ORG.RU

История изменений

Исправление merhalak, (текущая версия) :

Пока что решил проблему вот так.

К чему ты клонишь?

from modulefinder import ModuleFinder
from os import getcwd

finder = ModuleFinder()

finder.run_script("tests/util_test.py")

working_dir = getcwd()
for name, module in finder.modules.items():
    module_path = str(module.__file__)
    if module_path.startswith(working_dir) and not 'venv' in module_path:
        print(name)
        print(working_dir, module_path)

Исходная версия Deleted, :

Пока что решил проблему вот так.

К чему ты клонишь?

from modulefinder import ModuleFinder
from os import getcwd

finder = ModuleFinder()

for name, module in finder.modules.items():
    module_path = module.__file__
    print(name)

finder.run_script("tests/util_test.py")

working_dir = getcwd()
for name, module in finder.modules.items():
    module_path = str(module.__file__)
    if module_path.startswith(working_dir) and not 'venv' in module_path:
        print(name)
        print(working_dir, module_path)