INNER CODE UNIT · Python

import_file

scikit-image/scikit-image · src/_skimage2/_build_utils/__init__.py:12

def import_file(folder, module_name):
    """Import a file directly, avoiding importing scipy"""
    import importlib
    import pathlib

    fname = pathlib.Path(folder) / f'{module_name}.py'
    spec = importlib.util.spec_from_file_location(module_name, str(fname))
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)
    return module

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…